题目内容

下面程序段运行后,输出结果是________。#include#includevoidmain(){inti;chars1[6]="abcd";strcpy(s1,"fg");for(i=0;i<5;i++)if(s1[i]!='\0')s1[i]+=i;puts(s1);}

A. fg
B. 编译出错
C. fgcd
D. fgabcd

查看答案
更多问题

下列程序运行后,输出的结果是________。#includevoidmain(){charp[][10]={"BOOL","OPK","H","SP"};inti;for(i=3;i>=0;i--,i--)printf("%c",p[i][0]);printf("\n");}

A. BOHS
B. SHOB
C. HB
D. SO

函数f的功能是:测定字符串的长度,空白处应填入________。#includeintf(chars[]){inti=0;while(s[i]!='\0')i++;return(________);}voidmain(){printf("%d\n",f("goodbye!"));}

A. i-1
B. i
C. i+1
D. s

下列程序的输出结果是________。#includevoidmain(){charch[2][5]={"6934","8254"};inti,j;longs=0;for(i=0;i<2;i++)for(j=0;ch[i][j]>'0'&&ch[i][j]<='9';j++)s=10*s+ch[i][j]-'0';printf("%ld\n",s);}

A. 6385
B. 6982
C. 693825
D. 69348254

设已包含头文件,下面程序段的运行结果是________。chars1[20]="ancient";chars2[]="new";strcpy(s1,s2);printf("%d\n",strlen(s1));

A. 3
B. 4
C. 6
D. 7

答案查题题库