#include<stdio.h>
#include<string.h>
int main()
{
char s[100][20];
char t[20];
int n=0,i=0,j;
while(gets(s[i])!=NULL){
i++;
n++;
}
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(strcmp(s[i],s[j])>0)
{
strcpy(t,s[i]);
strcpy(s[i],s[j]);
strcpy(s[j]=t);
}
for(i=0;i<n;i++)
puts(s[i]);
}
哪里错了,运行都运行不了,字符串排序
额。。。。知道了 strcpy(s[j]=t);逗号写成等号了