多次输入字符串排序!!如:
qwe
eqw
asd
ads
zxc
cxz
qwe
eqw
asd
ads
zxc
cxz
程序代码:#include<stdio.h>
int main()
{
char str1[10];int i,h,t,j;int k=1;char c1,c2,c3;
for(h=0;h<3;h++)
{
for(i=0;i<=3;i++)//这块多循环一次,应该系统自动加“\0”
scanf("%c",&str1[i]);
for(i=0;i<=2;i++)
for(j=i;j<=2;j++)
if(str1[i]>str1[j])
{
t=str1[j];
str1[j]=str1[i];
str1[i]=t;
}
for(i=0;i<=2;i++)
{
printf("%c",str1[i]);
}
printf("\n");
}
return 0;
}