设有定义:"char s[12]={"string"};" 则printf("%d\n",strlen(s));的输出是( )
A.6
B.7
C.11
D.12
第1题:
以下程序段的输出结果是 char s[]="\\141\141abc\t"; printf ("%d\n",strlen(s));
A.9
B.12
C.13
D.14
第2题:
以下程序的输出结果,是_______。 main() { char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str)); }
A.6
B.7
C.11
D.12
第3题:
有以下程序 #include<string.h> main() { char *p=“abcde、Ofghjik\0”; printf(“%d\n”,strlen(p)); } 程序运行后的输出结果
A.12
B.15
C.6
D.5
第4题:
有以下程序
inculde <stdio.h>
inculde <string.h>
void Fun(char*str)
{ char temp;int n,I;
n=strlen(str);
temp=str[n-1];
For(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main()
{ char s[50];
ScanF(“%s”,s);Fun(s);printF(“%s\n”,s);}
程序运行后输入:aBcDeF<回车>,则输出结果是【 】
第5题:
若有以下定义和语句
char s1[10]=”aBcd!”,*s2=”\n123\\”
printF(“%d%d\n”,strlen(sl),strlen(s2));
则输出结果是
A.5 5
B.10 5
C.10 7
D.5 8
第6题:
以下程序的输出结果是______。 main() { char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str)); }
A.6
B.7
C.11
D.12
第7题:
设有如下程序: #include'string.h" main() { static char s1[20],s2[20]; scanf("%s",s1);scanf("%s",s2); if(strcmp(s1,s2)) printf("@"); else printf("$"); printf("%d\n",strlen(strcat(s1,s2))); } 如果从键盘上输入name1<回车>name2<回车>,则程序运行后的输出结果是( )。
A.$9
B.@11
C.$10
D.@10
第8题:
( 31 )若有以下定义和语句
char s1[10]= " abcd! " ,*s2= " \n123\\ ";
printf ( " %d %d\n ", strlen ( s1 ) ,strlen ( s2 ) ) ;
则输出结果是
A ) 5 5
B ) 10 5
C ) 10 7
D ) 5 8
第9题:
以下程序段的输出结果是()。 Char s[]I=”/1238/080abc”; printf(”%d/n”,strlen(s));
第10题:
设有定义:chars[12]=“string“;,则printf(“%d/n”,strlen(s));的输出是()。
第11题:
若有定义和语句: char s[10]:s=""abcd"";printf(""%s/n"",s); 则结果是(以下u代表空格)()
第12题:
第13题:
以下程序的输出结果是( ) #include<stdio.h> #include<string.h> main() {char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str)); }
A.6
B.7
C.11
D.12
第14题:
以下程序运行后输入:3,abcde<回车>,则输出结果是【 】
include <string.h>
move(char *str, int n)
{ char temp; int i;
temp=str[n-1];
for(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50]; int n, i, z;
scanf("%d,%s",&n,s);
z=strlen(s);
for(i=1; i<=n; i++) move(s, z);
printf("%s\n",s);
}
第15题:
有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
第16题:
设有定义:char s[12]={"hello"},则cout<<strlen(s)的输出是 ______。
A.5
B.6
C.11
D.12
第17题:
若有以下定义语句: char * sl="12345", * s2="1234"; printf("%d"n",strlen(strcpy(s1,s2))); 则输出结果是 ( )
A.4
B.5
C.9
D.10
第18题:
设有 static char str[]="Beijing"; 则执行 printf("%d\n",strlen(strcpy(str,"China"))); 后的输出结果为_______。
A.5
B.7
C.12
D.14
第19题:
设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d\n" ,strlen(s));
A.7
B.8
C.9
D.10
第20题:
设有定义:chars[12]=“string“;则printf(“%d/n“,sizeof(s));的输出是()。
第21题:
设有定义char*p=“abcde/0fghjik/0”;则printf(“%d/n”,strlen(p));输出结果是()
第22题:
设有char*a=”ABCD”;,则printf(“%s”,a)的输出是(),而printf(“%c”,*a)的输出是()。
第23题:
55
105
107
58