首页 > 职业资格考试> 企业法律顾问
题目内容 (请给出正确答案)
[单选题]

已知“chars[]="hello";”,则下面叙述中正确的是()。

A.数组s的长度为5

B.元素s[2]的值为'e'

C.使用“cin>>s;”可以将从键盘上键入的字符串保存在数组s中

D.使用“intt[]=s;”可以定义数组t、并用s中各元素的值初始化t中的各元素

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“已知“chars[]="hello";”,则下面叙述中正确的…”相关的问题
第1题
已知chars[]={"Hello"};数组s中字符串长度是_____.

点击查看答案
第2题
下面程序执行后的输出是()。#include#include#defineM1"Hello"#defineM2",world!"#defineMsg10#defineMsg20voidmain(){chars[100]="HHHH"#ifdefMsg1strcat(s,M2)#elifMsg2strcpy(s,M1)#elsestrcpy(s,strcat(strcpy(s,M1),M2))#endifputs(s)}

A.HHHH

B.Hello,world!

C.HHHHHello

D.HHHH,world!

点击查看答案
第3题
已知字符串s='hello',则表达式'he' not in 'hello'的值为()

A.'True'

B.'False'

C.True

D.False

点击查看答案
第4题
已知本地缓存中已经存在key=‘123’,value=‘hello’的一条数据,在执行wx.setStorageSync('123','world')代码后,本地缓存将发生怎样的变化()。

A.key='123',value=‘world’

B.key='123',value=‘hello’

C.key='123',value=‘’

D.报错,该键名称已经存在,无法写入。

点击查看答案
第5题
chars[]="student",*(s+2)的值是()。

A.’u’

B.‘d’

C.‘s’

D.‘t’

点击查看答案
第6题
有以下程序 include<stdio.h> intfun(charS[]) {intn=0; while(*s<=9&&*s>=0){n=10*n+*S-0;s

有以下程序 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

点击查看答案
第7题
chars=”goodstudent”(两个单词间有一空格),*(s+5)的值是()。

A.‘s’

B.‘’(空格)

C.‘d’

D.‘t’

点击查看答案
第8题
以下对数组s的初始化,错误的是_______

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" ;

点击查看答案
第9题
下面程序的功能是()。#include#includeintfun(chars[])voidmain(){chars1[100]printf("?s1:")gets(s1)printf("%d/n",fun(s1))}intfun(chars[]){intifor(i=0s[i]i++)returni}

A.将字符串s1拷贝给s

B.将字符串s拷贝给s1

C.统计字符串s1中有效字符个数

D.将字符串s1连接到s末尾

点击查看答案
第10题
有以下程序 include<stdio.h> yoidmain() { chars[]:{012xy};inti,n=0; for(i=0;s[i]!=

有以下程序 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

点击查看答案
第11题
有以下程序 include<stdio.h> yoidmain() { chars[]=012xy\08s34f4w2; inti,n=0; for(

有以下程序 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

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改