#include <string.h>
#include <conio.h>
#define NUM 7
void countrysort(char **p);
main()
{char * country[NUM]={"China","America","France","England","SouthKrean","Canada","Borland"};
int i;
countrysort(country);
for(i=0;i<NUM;i++)
printf("%s\n",country[i]);
getch(); /* 请不要删除此行 */
}
void countrysort(char * *p)
{char *maxstring;
int i,j,k;
for(i=0;i<NUM-1;i++)
{ k=i;
maxstring=*(p+i);
for(j=i+1;j<NUM;j++)
if(strcmp(*(p+j),maxstring)>0)
{ maxstring=*(p+j);k=j ;}
if(k!=i)
{ *(p+k)=*(p+i);
*(p+i)=maxstring;
}
}
}
After all,tomorrow is another day!!!!