请问我做的那个地方错了阿!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
请问我做的那个地方错了阿!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
从键盘输入5个字符串,用起泡法对这5个字符串排序提示:可以定义一个二维字符数组char str[5][100], 分别将5个从键盘输入的字符串存到str[i]中(i =0 ~ 4).
请问我做的那个地方错了阿!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
------------------------------------------------------------
#include "stdio.h"
void main()
{char a[5][100],t;
int i,j,k,l=1;
{for(k=0;k<5;k++)
{for(i=1;i<=100;i++)
fflush(stdin);
scanf("%c",&a);
}
}
for(k=1;k<=5;k++)
{for(j=1;j<=100;j++)
{for(i=1;i<=100-j;i++)
{if(a[k][i]>a[k][i+1])
{t=a[k][i];a[k][i]=a[k][i+1];a[k][i+1]=t;}
}
}
}
printf("number\n");
for(k=0;k<5;k++)
{for(i=1;i<=100;i++)
{printf("%c",a[k][i]);}
printf("\n");}
}