已知“chars[]="hello";”,则下面叙述中正确的是()。
A.数组s的长度为5
B.元素s[2]的值为'e'
C.使用“cin>>s;”可以将从键盘上键入的字符串保存在数组s中
D.使用“intt[]=s;”可以定义数组t、并用s中各元素的值初始化t中的各元素
A.数组s的长度为5
B.元素s[2]的值为'e'
C.使用“cin>>s;”可以将从键盘上键入的字符串保存在数组s中
D.使用“intt[]=s;”可以定义数组t、并用s中各元素的值初始化t中的各元素
A.HHHH
B.Hello,world!
C.HHHHHello
D.HHHH,world!
A.key='123',value=‘world’
B.key='123',value=‘hello’
C.key='123',value=‘’
D.报错,该键名称已经存在,无法写入。
有以下程序 include<stdio.h> intfun(charS[]) {intn=0; while(*s<=9&&*s>=0){n=10*n+*S-0;s++;) return(n); } main() {chars[10]={6,1,*,4,*,9,*,0,*); printf(%d\n,fun(s)); } 程序的运行结果是
A.61490
B.61
C.9
D.5
A.char s[5] = { "abc" } ;
B.chars[5] = { &39;a&39; , &39;b&39; , &39;c&39; } ;
C.char s[5] = "" ;
D.chars[5] = "abcde" ;
A.将字符串s1拷贝给s
B.将字符串s拷贝给s1
C.统计字符串s1中有效字符个数
D.将字符串s1连接到s末尾
有以下程序 include<stdio.h> yoidmain() { chars[]:{012xy};inti,n=0; for(i=0;s[i]!=0;i++) if(s[i]>=a&&s[i]<==Z)n++; printf(%d\n,n); } 程序运行后的输出结果
A.0
B.3
C.5
D.2
有以下程序 include<stdio.h> yoidmain() { chars[]=012xy\08s34f4w2; inti,n=0; for(i=0;s[i]!=0;i++) if(s[i]>=0&&s[i]<=9)n++; printf(%d\n,n); } 程序运行后的输出结果是
A.0
B.7
C.3
D.8