题目内容 (请给出正确答案)
[主观题]

对下面程序段的描述正确的是()。 #include <iostream> using namespace std; int Fun(int x, int y) { return x+y; } int main() { int i=10; cout< <fun(i++, return 0;>

B、程序输出结果是 20

C、程序输出结果是 21

D、程序输出结果是 22

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“对下面程序段的描述正确的是()。 #include <ios…”相关的问题

第1题

有如下程序: #include<iostream> usingnamespacestd; intmain( ){ intf,f1=0,f2=1; for(inti=3;i<=6;i++){ f=f1+f2: f1=f2;f2=f; } cout<<f<<endl; return0; } 运行时的输出结果是( )。

A.2

B.3

C.5

D.8

点击查看答案

第2题

有如下程序: #include<iostream> usingnamespacestd; classVAC{ public; intf()const(return3;} intf(){return5;} }; Intmain(){ VACv1:

constVACv2; cout<<v1.f()<<v2.f(); return0; } 运行时的输出结果是()。

A.53

B.35

C.55

D.33

点击查看答案

第3题

有如下程序: #include<iostream> usingnamespacestd; classVAC{ public; intf()const(return3;} intf(){return5;} }; Intmain(){ VACv1:

constVACv2; cout<<v1.f()<<v2.f(); return0; } 运行时的输出结果是()。

A.53

B.35

C.55

D.33

点击查看答案

第4题

有如下程序: #include<iostream> using namespace std; class VAC{ public: intfconst{return 3;} int f{retum 5;} }; int main { VAC vl; const VAC v2; cout<<vl.f<<v2.f; return 0; } 执行这个程序的输出结果是( )。

A.53

B.35

C.55

D.33

点击查看答案

第5题

有如下程序: #include<iostream> usingnamespacestd; voidf1(int&X,int&y){intz=X;x=y;y=z} voidf2(intX,inty){intz=x;x=y;y=z} intmain( ){ intx=10,y=26 f1(x,y); f2(X,y); cout<<y<<endl; return0; } 运行时的输出结果是( )。

A.10

B.16

C.26

D.36

点击查看答案

第6题

有如下程序: #included<iostream> usingnamespacestd; voidfl(int&X,int&y){intz=x;x=y;y=z;)voidf2(intX,inty){intz=x;x=y;y=z;}intmain( ){ intx=10,y=26; f1(X,y); f2(x,y); cout<<y<<endl; return0; } 运行时的输出结果是( )。

A.10

B.16

C.26

D.36

点击查看答案

第7题

有如下程序:

#include<iostream>

usingnamespacestd;

voidf1(int&X,int&y){intz=X;x=y;y=z}

voidf2(intX,inty){intz=x;x=y;y=z}

intmain( ){

intx=10,y=26

f1(x,y);

f2(X,y);

cout<<y<<endl;

return0;

}

运行时的输出结果是( )。

A.10

B.16

C.26

D.36

点击查看答案

第8题

有如下程序: #include<iostream> using namespace std; class Base { public: void funl{cout<<”Base\n”;} virtual void fun2{eout<<”Base\n”;} }; class Derived:public Base{ public: void funl{eout<<”Derived、n”;} void fura{eout<.<”Derived\n”;} }; void f(Base&B.}b.funl;b.ftm2;} int main { Derived obj; f(obj); return 0; } 执行这个程序的输出结果是( )。

A.Base Base

B.Base Derived

C.Derived Base

D.Derived Derived

点击查看答案

第9题

有如下程序: #include<iostream> using namespace std; class Base { private: void funlconst{tout<<”funl”;} protected: void fun2const{tout<<”fun2”;} public: void fun3const{cout<<”fhll3”;} }; class Derived:protected Base { public: void fhn4const{cout<<”filn4”;} }; int main { Derived obj; obj.funl;//① obj.fun2;//② obj.furd;//③ obj.fun4;//④ return U: } 其中有语法错误的语句是( )。

A.①②③④

B.①②③

C.②③④

D.①④

点击查看答案

第10题

( 32 )有如下程序:

#include<iostream>

Using namespace std;

class A{

public:

virtual void f () {cout+1;}

void g () {cout<<2;}

};

class B:public A{

public:

virtual void f () {cout<<3;}

void g () {ecut<<4;}

};

void show ( A &a ) {a.f ( ) ; a.g ( ) ; }

int main () {

B b;

show ( b ) ;

return 0;

}

运行时的输出结果是

A ) 12

B ) 34

C ) 14

D ) 32

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信