首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

下列程序的输出结果是#include<iostream.h>void main(){char*str="12123434";int xl=0,x2=0,x3=

下列程序的输出结果是 #include<iostream.h> void main() {char*str="12123434"; int xl=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) {case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout<<x1<<","<<x2<<","<<x3<<","<<x4; }

A.8,6,4,1

B.8,6,3,2

C.8,8,4,1

D.8,6,4,2

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“下列程序的输出结果是#include<iostream.h>…”相关的问题
第1题
下列程序的输出结果是()。 #include<iostream> using namespace std; class TestClass{ static in

下列程序的输出结果是()。 #include<iostream> using namespace std; class TestClass{ static int i; public: TestClass(){i++;} ~TestClass(){i--;} static int getVal(){retum i;} }; int TestClass∷i=0; voi

A.111

B.121

C.211

D.221

点击查看答案
第2题
下列程序的输出结果是()。 #include<stdio.h> main() { int i; for(i=1 ;i<=10; i++) { if((i*i>=20)&&(i*i<=100)) } break; printf("%d\n",i*i); }

A.49

B.36

C.25

D.64

点击查看答案
第3题
下列程序的输出结果是______。 include<iostream.h>void main(){ char a[]="abcdabcabfgacd"; in

下列程序的输出结果是______。

include<iostream.h>

void main()

{

char a[]="abcdabcabfgacd";

int i1=0,i2=0,i=0;

while(a[i])

{

if(a[i]=="a")i1++;

if(a[i]=="b")i2++;

i++;

}

cout<<i1<<""<<i2<<endl;

}

点击查看答案
第4题
下列程序的输出结果是()。 #include<stdio.h> main { int i; for(i=1;i<=10,i++) { if(

下列程序的输出结果是()。 #include<stdio.h> main { int i; for(i=1;i<=10,i++) { if((i*i>=20)&&(i*i<=100)) break; } printf("%d\n",i*i; }

A.49

B.36

C.25

D.64

点击查看答案
第5题
下列程序的输出结果是()。#include<stdio.h>main{ int i;for(i=1;i<=10,i++){ if((i*i&

下列程序的输出结果是()。

#include<stdio.h>

main

{ int i;

for(i=1;i<=10,i++)

{ if((i*i>=20)&&(i*i<=100))

break;

}

printf("%d\n",i*i;

}

A.A.49

B.36

C.25

D.64

点击查看答案
第6题
下列程序的输出结果是()。#include<stdio.h>main(){int a=0,i; for(i=1;i<5;i++) { switch(i) { c

下列程序的输出结果是()。 #include<stdio.h> main() { int a=0,i; for(i=1;i<5;i++) { switch(i) { case 0: case 3:a+=1; case 1: case 2:a+=2; default:a+=3; } printf("%d",A) ; }

A.19

B.18

C.6

D.8

点击查看答案
第7题
下列程序执行输出的结果是()。#include<stdio.h>f(int a){ int b=0;static c=3;a=c++;b++;return(

下列程序执行输出的结果是()。 #include<stdio.h> f(int a) { int b=0; static c=3; a=c++;b++; return(a); } main() { int a=2,i,k; for(i=0;i<2;i++) k=f(a++); printf("%d\n",k); }

A.3

B.4

C.5

D.6

点击查看答案
第8题
有下列程序: #include<stdi0.h>voidmain() {char*a[]={"abed","ef"

有下列程序:

#include<stdi0.h>

voidmain()

{char*a[]={"abed","ef","gh","ijk");inti;

for(i=0;i<4;i++)printf("%C",*a[i]);

}

程序运行后的输出结果是()。

A.aegi

B.dfhk

C.abed

D.abcdcfghijk

点击查看答案
第9题
下列程序的输出结果是()。 #include<stdio.h> main() { int a=0,i; for(i=1;i<5;i

下列程序的输出结果是()。 #include<stdio.h> main() { int a=0,i; for(i=1;i<5;i++) { switch(i) { case 0: case 3:a+=1; case 1: case 2:a+=2; default:a+=3; } } printf("%d",i); }

A.19

B.1

C.6

D.8

点击查看答案
第10题
下列程序的输出结果是【 】。include<stdio.h> void swap(int *a, int *B) { int *t; t=a;a=b;b=t;

下列程序的输出结果是【 】。

include <stdio.h>

void swap(int *a, int *B)

{

int *t;

t=a;a=b;b=t;

}

main()

{

int i=3,j=5,*p=&i,*q=&j;

swap(p,q);printf("%d %d\n",*p,*q);

}

点击查看答案
第11题
下列程序的输出结果是 #include"stdio.h" #defineN3 #defineM3 voidfun(inta[M][N]) {p

下列程序的输出结果是

#include "stdio.h"

#define N 3

#define M 3

void fun(int a[M][N])

{printf("%d\n",*(a[1]+2));}

main()

{int a[M][N];

int i,j;

for(i=0;i<M;i++)

for(j=0;j<N;j++)

a[i][j]=i+j-(i-j);

fun(a);}

A.3

B.4

C.5

D.6

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