C语言用指针按字母顺序排国家名答:include<stdio.h> include<string.h> void main(){ void sort(char *name[],int n),print(char *name[],int n);char *name[]={"China","Italy","Iran","France","Greek"};int n=5;sort(name,n);print(name,n);} void sort(char *name[],int n){ char *temp;int i,j;for...
C语言 用指针方法 输入3个字符串 按由小到大顺序输出?答:{ void swap(char** p, char** q);char s1[100], s2[100], s3[100];char *p1, *p2, *p3;printf("please inter three strings:\n");p1 = fgets(s1, 100, stdin);p2 = fgets(s2, 100, stdin);p3 = fgets(s3, 100, stdin);if (strcmp(p1, p2) > 0)swap(&p1, &p2);i...