程序代码:
#include <stdlib.h> #include <string.h> #define N 4000000 #define LEN 36 int main(void) { char *ar = (char*)malloc(sizeof(char)*N*(LEN+1)); /* 或者 * char **ar = (char**)malloc(sizeof(char*)*N); * ar[0]=(char*)malloc(sizeof(char)*(N+1)); * 输入 ar[0] * ar[1] * ...... */ qsort(ar, N, (LEN+1)*sizeof(char), strcmp); return 0; }
—>〉Sun〈<—