题目详情:
发布时间:2020-06-20 22:27:06
[单选题]以下程序中函数f的功能是将n个字符串,按由大到小的顺序进行排序。
#include <string.h>
Void f(char p[][10],int n)
{ char t[20]; 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[][10]={"abc","aabdfg","abbd","dcdbe","cd"};
F(p,5); printf("%d\n",strlen(p[0]));
}
程序运行后的输出结果是()。
A.6
B.4
C.5
D.3
更多"[单选题]以下程序中函数f的功能是将n个字符串,按由大到小的顺序进行排"的相关试题: