单项选择题
有以下程序:
#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]="abc"," aabdfg"," abbd","dcdbe"," cd");
f(p,5);
printf("%d\n",strlen(p[0]));
程序运行后输出的结果是( )。
A.2
B.4
C.6
D.3
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <stdio.h> struct ord int x,y;dt[2]=1,2,3,4; main() struct ord *p=dt; printf( %d ,++p->x);printf( %d n ,++p->y); 程序的运行结果是( )。
A.1,2
B.2,3
C.3,4
D.4,1
点击查看答案
单项选择题
在C语言中,只有在使用时才占用内存单元的变量,其存储类型是( )。
A.auto和register
B.extern和register
C.auto和static
D.static和register
点击查看答案
相关试题
以下程序运行后输出的结果是______。...
下列程序的输出结果是______。 void...
已知数字 0 的ASCⅡ码值为48,在程序...
若输入字符串:abcde ,则以下while循环体...
以下程序运行后输出的结果是______。...