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

下面程序的运行结果为#include<iostream. h>class A{public:A() {cout < <"1";}~A() {cout < <"2";}};class B:public A{public:B() {cout < <"3";}~B() {cout < <"4";}};void main(){B b;}

A.1234

B.1324

C.1342

D.3142

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

下面程序的运行结果为()。 #include<iostream.h> class A { int hum; public: A(int i){nuln=i;} A(A&A.{num=a.num十+;} void print{eout(<hum;} }; void main A a(1),b(A.; a.print; A print;

A.11

B.12

C.21

D.22

点击查看答案
第2题
下面程序的运算结果为 ()。#include < iostream >using namespace ~td;int i;int fun() { stati

下面程序的运算结果为 ()。 #include < iostream > using namespace ~td; int i; int fun() { static int i = 10; return + + i; void main () { fun(); cout <<fun() <<" ," <<i; }

A.10,100

B.12,100

C.12,12

D.11,100

点击查看答案
第3题
下面程序的运行结果为()。 #include<iostream.h> voidmain() { chara=3: switch(a) {

下面程序的运行结果为()。 #include<iostream.h> voidmain() { chara=3: switch(a) { case3:cout<<"3"; case2:cout<<"2";break; default:cout<<"1"; } }

A.3

B.321

C.31

D.32

点击查看答案
第4题
阅读下列程序,则运行结果为#include"stdio.h"fun(){staticint x=5; x++; return x;}main(){int i

阅读下列程序,则运行结果为 #include"stdio.h" fun() { static int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}

A.5

B.6

C.7

D.8

点击查看答案
第5题
下面程序的运行结果为 #include voidmain() { for(inta=0,x=0;!x&&a<=10;a+

下面程序的运行结果为

#include

void main()

{

for(int a=0,x=0;!x&&a<=10;a++)

{

a++;

} l

cout<<

}

A.10

B.11

C.12

D. 0

点击查看答案
第6题
下列程序的运行结果为()。 #include<iostream.h> int i=0; class A{ public: A{i++;}
}; void main { A a,b[3],*C; C=b; cout<<i<<endl: }

A.2

B.3

C.4

D.5

点击查看答案
第7题
下面程序的运行结果为()。#include<iostream.h> voidswap(int&a,intb) { inttemp; temp=

下面程序的运行结果为()。#include<iostream.h> voidswap(int&a,intb) { inttemp; temp=a++; a=b: b=temp: } voidmain() { inta=2,b=3; swap(a,b); cout<<a<<","<<b<<endl; }

A.2,3

B.3,2

C.2,2

D.3,3

点击查看答案
第8题
下面程序的运行结果为#include<iostream.h>void main(){for(int a =0,x=0;!x&&a<=10;a++){a++;}cout < < a < < endl;}

A.10

B.11

C.12

D.0

点击查看答案
第9题
下面程序的运行结果为()。 #include<iostream> using namespace std; void swap(int &

下面程序的运行结果为()。 #include<iostream> using namespace std; void swap(int &a,int &b){ int temp; temp=a; a=b; b=temp; } void main(){ int a=2,b=3; swap(a,b); cout<<a<<"," <<b<<ENDL; }

A.2,3

B.3,2

C.2,2

D.3,3

点击查看答案
第10题
阅读下列程序,则运行结果为#include "stdio.h"fun(){ static int x=5;x++;return x;}main(){ int i,x;for(i=0;i<3;i++)x=fun();printf("%d\n",x);}

A.5

B.6

C.7

D.8

点击查看答案
第11题
阅读下列程序,则运行结果为 #include "stdio.h" fun() { staic int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}

A.5

B.6

C.7

D.8

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