帮忙看看 输入三个字符串,按从小到大输出
要求输入三个字符串,按从小到大顺序输出
2008-10-20 22:39
2008-10-20 22:54

2008-10-20 23:16
2008-10-20 23:32
2008-10-20 23:36
2008-10-21 10:31
程序代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char list[3][11];
int main(void)
{
int x;
for (x = 0; x < 3; x++)
scanf("%10s", list[x]);
qsort(list, 3 , sizeof(list[0]), (void*)strcmp);
for (x = 0; x < 3; x++)
printf("%s\n", list[x]);
return 0;
}
2008-10-21 10:40
2008-10-21 10:47