#include<stdio.h>#include<string.h>void main(){ void sort(char *s[],int n); static char *name[5]={"basic","fortran","cobol","pascal","c"}; int i; sort (name,5); printf("新排序字符串:\n"); for (i=0;i<5;i++) puts(name[i]);}void sort(char *s[],int n){ char *t; int i,j,k; for (i=0;i<n-1;i++){ k=i; for (j=i+1;j<n;j++) if (strcmp(s[k],s[j])>0) k=j; if (k!=i) t=s[i],s[i]=s[k],s[k]=t; }}