#define LINEMAX 20
int main()
{
int i;
char **p,pstr[5],str[5][LINEMAX];
for (i=0; i<5; i++)
pstr[i]=str[i];
printf(“输入五个字符串:\n”);
for (i=0; i<5; i++)
scanf("%s",pstr[i]);
p=pstr;
sort§;
printf(“排序后的字符串:\n”);
for (i=0; i<5; i++)
printf("%s\n",pstr[i]);
}
sort(char **p)
{
int i,j;
char temp;
for (i=0; i<5; i++)
{
for (j=i+1; j<5; j++)
{
if (strcmp((p+i),(p+j))>0)
{
temp=*(p+i);
(p+i)=(p+j);
*(p+j)=temp;
}
}
}
}