1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 /* 9 bool cmp(char *a,char *b)10 {11 int len1 = strlen(a);12 int len2 = strlen(b);13 return len1>len2;14 }15 */16 int cmp(const void *a,const void *b)17 {18 int len1 = strlen((char *)a);19 int len2 = strlen((char *)b);20 return len1>len2;21 }22 23 int main()24 {25 char str[16][25];26 int i,j,k=1;27 int num;28 while(scanf("%d",&num),num)29 {30 memset(str, 0, sizeof(str)); 31 for(i=0;i >str[i];33 //sort(str,str+num,cmp);34 qsort(str,num,25,cmp);35 printf("SET %d\n",k);36 k++;37 for(i=0;i 0;j-=2) 40 cout< <