C语言
第901题
有以下程序:
#include <stdio.h>
main()
{
char b[4][10],c;
int i,j;
for(i=0;i<4;i++)
{
j=0;
while((c=getchar())!=' '&& c!='\n')b[i][j++]=c;
b[i][j] = '\0';
}
printf("%s%s%s%s\n",b[0],b[1],b[2],b[3]);
}程序运行时从第一列开始输入: Peach flower is pink.<回车>
则输出结果是()。
第902题
有以下程序:
#include <stdio.h>
#include <string.h>
main()
{
char w[20], a[5][10] = {"abcdef", "ghijkl", "mnopq", "rstuv", "wxyz"};
int i,j;
for(i=0;i<5;i++)
{
j=0;
while(a[i][j]!='\0')j++;
w[i]=a[i][j-2];
}
w[5]='\0';
puts(w);
}程序运行后的输出结果是()。
第903题
有以下程序:
#include <stdio.h>
main()
{
char *a[]={"abcd","ef","gh","ijk"};
int i;
for(i=0;i<4;i++)printf("%c",*a[i]);
}程序运行后的输出结果是()。
第904题
有以下程序:
#include <stdio.h>
#include <string.h>
main()
{
char *mm[4]= {"abcd", "1234", "mnop", "5678"};
char **pm= mm;
int i;
for(i=0;i<4;i++) printf("%s",pm[i]+i);
printf("\n");
}程序的运行结果是()。
第905题
有以下程序:
#include <stdio.h>
main()
{
char *s[6]={"ABCD","EFGH","IJKL","MNOP","QRST","UVWX"},**p;
int i;
p=s;
for(i=0;i<4;i++)printf("%s",p[i]);
printf("\n");
}程序运行后的输出结果是()。
第906题
有以下程序
#include <stdio.h>
main()
{
char c[2][5]={"6938","8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)
p[i]=c[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>0;j+=2)
s=10*s+p[i][j]-'0';
printf("%d\n",s);
}程序运行后的输出结果是()。
第907题
有以下程序
#include <stdio.h>
void fun(char **p)
{
++p;
printf("%s\n",*p);
}
main()
{
char *a[] = {"Morning", "Afternoon", "Evening", "Night"};
fun(a);
}程序的运行结果是()。
第908题
以下关于字符串的叙述中正确的是()。
第909题
若有定义语句char s[10]="1234567\0\0",则strlen(s)的值是()。
第910题
下列选项中,能够满足“若字符串s1等于字符串s2,则执行ST”要求的是()。
第911题
字符数组a和b中存储了两个字符串,判断字符串a和b是否相等,应当使用的是()。
第912题
若有定义语句
char*s1="OK",*s2="ok";
以下选项中能够输出"OK"的语句是()。
第913题
若有定义语句:
char str1[] = "string", str2[8], *str3, str4[10] = "string";
库函数strcpy的功能是复制字符串,以下选项中错误的函数调用是()。
第914题
以下不能将s所指字符串正确复制到t所指存储空间的是()。
第915题
若有以下定义和语句:
char s1[10]="abcd!", *s2="n123\\";
printf("%d%d\n", strlen(s1), strlen(s2));则输出结果是()。
第916题
以下语句的输出结果是()。
printf("%d\n",strlen("\t\"\065\xff\n"));
第917题
有如下程序:
#include <stdio.h>
#include <string.h>
main()
{
printf("%d\n",strlen("0\t\nA011\1"));
}程序运行后的输出结果是()。
第918题
有以下程序:
#include<stdio.h>
#include<string.h>
main()
{
char a[10]= "abcd";
printf("%d,%d\n",strlen(a),sizeof(a));
}程序运行后的输出结果是()。
第919题
有以下程序:
#include <stdio.h>
#include <string.h>
main()
{
char str[]={"Hello,Beijing"};
printf("%d,%d\n",strlen(str),sizeof(str));
}程序的运行结果是()。
第920题
有以下程序:
#include <stdio.h>
#include <string.h>
main()
{
char x[]="STRING";
x[0]=0;
x[1]='\0';
x[2]='0';
printf("%d %d\n",sizeof(x),strlen(x));
}程序运行后的输出结果是()。