第1题
以下程序的输出结果是_[13]_______
#include <stdio.h>
#include <string.h>
char *fun(char *t)
{ char *p=t;
return(p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=fun(str);
puts(str);
}
第2题
有以下程序
#include <stdio.h>
#include <string.h>
main()
{ printf("%d\n",strlen ("ATS\n012\1") ); }
程序运行后的输出结果是
A)3
B)8
C)4
D)9
第3题
有以下程序
#include<stdio.h>
#include<string.h>
main()
{char a[10]=”abcd”;
prinff(“%d,%d\n”,strlen(A),sizeof(A));
}
程序运行后的输出结果是
A.7,4
B.4,10
C.8,8
D.10,lO
第4题
阅读下列程序,则在执行后,程序的运行结果为
#include "stdio.h"
#include "string.h"
main()
{ char a[30]="nice to meet you!";
strcpy(a+strlen(a)/2,"you");
printf("%s\n",a);}
A.nice to meet you you
B.nice to
C.meet you you
D.nice to you
第5题
阅读下列程序,则在执行后,程序的运行结果为
#include "stdio.h"
#include "string.h"
main()
{ char a[30]="nice to meet you!";
strcpy(a+strlen(a)/2,"you");
printf("%s\n",a);}
A.nice to meet you you
B.nice to
C.meet you you
D.nice to you
第6题
有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是()。
A.0
B.5
C.7
D.20
第7题
有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是()。
A.2
B.3
C.4
D.5
第8题
有以下程序 include<stdio.h> include<string_h> voidfun(char*W,intm) {chars,*p1,*p2; p1=w;p2=w+m-1; while(pl<p2){s=*p1;*p1=*p2;*p2=s;p1++;p2-;} } main() {1chara[]=“123456“; fun(a,strlen(a));puts(a); }
A.116611
B.161616
C.65432l
D.123456
第9题
有以下程序:#include <stdio.h>#include <string.h>main() { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是()。
A.22
B.76
C.72
D.62
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!