#include <stdio.h>
#include <conio.h>
#include <string.h>
const int SIZE = 10;
int main(void)
{
void Sort(char *stra[]);
char *stra[SIZE] = {"fan", "song", "zhang", "zhao", "wang",
"li", "yin", "shu", "tian", "wei"};
int ia, ipass;
Sort(stra);
for (ia = 0; ia < SIZE; ia++)
{
printf("%s\n", stra[ia]);
}
getch();
return 0;
}
void Sort(char *stra[])
{
int ib, ipass;
char strb[10];
for (ipass = 1; ipass < SIZE; ipass++)
{
for (ib = 0; ib < SIZE - 1; ib++)
{
if (strcmp(stra[ib], stra[ib + 1]) > 0)
{
strcpy(strb, stra[ib]);
strcpy(stra[ib], stra[ib + 1]);
strcpy(stra[ib + 1], strb);
}
}
}
}