#include <stdio.h>
#include<string.h>
int main()
{
char name[10][10] = { "America","China","France","Germany","Australia","Japan","Korea","Russia","England","India" };/initialize the name array/
int i, j;/counters of row and column/
char* a[10];/define the point array of the fisrt character of names/
char* x[1];
printf("Input the English names of ten countries:\n");
for (i = 0; i < 10; i++) {
a[i] = &name[i][0];/*assign the address of the first character of name to the point array*/
}
/*bubble sorting*/
for (i = 0; i < 10; i++) {
for (j = 0; j < 10; j++) {
if (a[j], a[j + 1] > 0) {
x[0] = a[j];
a[j] = a[j + 1];
a[j + 1] = x[0];
}
}
printf("The sorted order of names is:\n");
for (i = 0; i < 10; i++) {
printf("%s", a[i]);/*outout the array*/
}
}
return 0;
}