//没用2为字符串,麻烦死。用的结构体#include<stdio.h>#include<string.h>#include<stdlib.h>typedef struct { char c[105];}Line;Line a[10];int cmp(const void *x,const void *y){ char *m = ((Line*)x)->c; char *n = ((Line*)y)->c; return strcmp(m,n);}int main(){ int L,M,i,x,y,ans; for(i = 0;i < 10;i ++) scanf("%s",a[i].c); qsort(a,10,sizeof(a[0]),cmp); for(i = 0;i < 10;i ++) printf("%s\n",a[i].c); return 0;}