1.字符串
char a[100][20];
int comp(const void *a,const void *b)
{
return strcmp((char *)a,(char *)b);
}
int main()
{
int n,j,i;
cin>>n;
for (i=0;i<n;i++) cin>>a[i];
qsort(a,n,sizeof(char)*20,comp);
for (i=0;i<n;i++) cout<<a[i]<<endl;
return 0;
}
2.