# include & ltstdio.h & gt
# include & ltstring.h & gt
int main()
{
char a[1000][100],tmp[100];
int i,j,line
//初始化tmp 2D數組
for(I = 0;我& lt100;i++)
tmp[I]= ' \ 0 ';
//回車!!!
I = 0;
做{
獲取(a[I]);
i++;
} while(strlen(a[I-1])& gt;0 );
line = I-1;//最後壹個數組下標
//冒泡排序,字典按行排序
for(I = 0;我& lt線;i++)
for(j = 0;j & lt行-1;j++){
if (strcmp(a[j],a[j+1])& gt;0){
strcpy(tmp,a[j]);
strcpy(a[j],a[j+1]);
strcpy(a[j+1],tmp);
}
}
//輸出
for(I = 0;我& lt線;i++)
printf ("%s\n ",a[I]);
返回0;
}