A. 没有改变
B. 变长了
C. 缩短了
D. 可以根据需要设定
第1题
有以下程序
#include <stdio.h>
#include <string.h>
main()
{ printf("%d\n",strlen ("ATS\n012\1") ); }
程序运行后的输出结果是
A)3
B)8
C)4
D)9
第2题
以下程序的输出结果是【 14 】
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{ char *p,*q,*r,
p=q=r=(char*)malioc(sizeof(char)*20);
strcpy(p,"attaboy,welcome!");
printf(”%c%c%c\n”,p[ 11 ], q[ 3 ],r[ 4 ]);
free(p);
}
第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 str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是()。
A.0
B.5
C.7
D.20
第5题
以下程序的输出结果是_[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);
}
第6题
有以下程序
#include <stdio.h>
#include <string.h>
typedef strlIct{char name[9];char sex;float score[2];}STU;
STU f(STU a)
{ STU b={"Zhao",'m',85.0,90.0);int i;
strcpy(a name,b.name);
sex:b.sex;
for(i=0;i<2;i++)a.score[i]=b.score[i];
return a;
}
main
{STU c="Qian",'f',95.0,92.0},d;
d=f(c).printf("%s,%c,%2.0f,%2.0f",d.Name,d.sex,d.score[0],d.score[1]);
}
程序的运行结果是()。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,m,85,90
D.Zhao,f,95,92
第7题
有以下程序
#include <stdio.h>
#include <string.h>
typedef struct{ char name[9];char sex; float score[2]; } STU;
STU f(STU a)
{ STU b={"Zhao",'m',85.0,90.0}; int i;
strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++) a.score[i]=b.score[i];
return a;
}
main()
{ STU c={"Qian",'f',95.0,92.0},d;
d=f(c); printf("%s,%c,%2.0f,%2.0f\n",d.name,d.sex,d.score[0],d.score[1]);
}
程序的运行结果是
A)Qian,f,95,92
B)Qian,m,85,90
C)Zhao,m,85,90
D)Zhao,f,95,92
第8题
有以下程序: #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
第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
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!