//參考:
#include
int main()
{
char name[10][20], temp[20];
int i,j;
for (i = 0; i
scanf ("%s", name[i]);
}
for (j = i+1; j
if (strcmp(name[i], name[j])
strcpy(temp, name[i]);
strcpy(name[i], name[j]);
strcpy(name[j], temp);
printf ("%s\n", name[i]);
return 0;
//參考:
#include
#include
int main()
{
char name[10][20], temp[20];
int i,j;
for (i = 0; i
scanf ("%s", name[i]);
}
for (i = 0; i
for (j = i+1; j
if (strcmp(name[i], name[j])
strcpy(temp, name[i]);
strcpy(name[i], name[j]);
strcpy(name[j], temp);
}
}
}
for (i = 0; i
printf ("%s\n", name[i]);
}
return 0;
}