有以下程序:
#include <stdio.h>
#include <string.h>
void f(char p[][10], int n) /*字符串从小到大排序*/
char t[10]; int i, j;
for (i=0; i<n-1; i++)
for(j=i+1; j<n; j++)
if (strcmp(p[i], p[j]) >0)
strcpy(t, p[i]);
strcpy(p[i], p[j]);
strcpy(p[j], t);
main()
char p[5][10]="123", "aabdfg", "abbd", "dcdbe", "cd";
f(p, 5);
printf("% d\n ", strlen(p[0]) );
A) 2
B) 4
C) 6
D) 3