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

下列程序的输出结果为2,请将程序补充完整。 include<iostream> using namespace std; class Base

下列程序的输出结果为2,请将程序补充完整。

include<iostream>

using namespace std;

class Base

{

public:

______void fun(){cout<<1;}

};

class Derived:public Base

{

public:

void fun(){cout<<2;}

};

int main()

{

Base*p=new Derived;

p->fur();

delete p;

return 0;

}

查看答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“下列程序的输出结果为2,请将程序补充完整。 include<…”相关的问题

第1题

下列程序的输出结果为2,请将程序补充完整。 include <iostream> using namespaee std; class B

下列程序的输出结果为2,请将程序补充完整。

include <iostream>

using namespaee std;

class Base{

public:

______void fun(){cout<<1;}

};

class Derived:public Base{

public:

void fun(){cout<<2;}

};

int main(){

Base*P=new Derived:

p->fun();

delete P;

return 0;

}

点击查看答案

第2题

下列程序的输出结果为2,请将程序补充完整。 include<iostream> using namespace std; class Basc

下列程序的输出结果为2,请将程序补充完整。

include<iostream>

using namespace std;

class Basc

{

public:

【 】void fun(){cout<<1;}

};

class Dcrived:public Base

{

public:

void fun(){cout<<2;}

};

int main()

{

Base*p=new Derived;

p->fun();

delete p;

return 0;

}

点击查看答案

第3题

若下列程序运行时输出结果为 1,A,10.1 2,B,3.5 请将程序补充完整。 include<iostream> using name

若下列程序运行时输出结果为

1,A,10.1

2,B,3.5

请将程序补充完整。

include<iostream>

using namespace std;

int main()

{

void test(int,char,double______);

test(1,'A',10.1);

test(2,'B');

return 0;

}

void test(int a,char b,double c)

{

cout<<a<<','<<b<<','<<c<<end1;

}

点击查看答案

第4题

若下面程序运行时输出结果为1, A, 10.12, B, 3.5请将程序补充完整 。 #includeusing namespac

若下面程序运行时输出结果为

1, A, 10.1

2, B, 3.5

请将程序补充完整 。

#include

using namespace std;

int main()

{

void test(int, char,double 【 8 】 );

test(1,'A',10.1);

test(2,'B');

return 0;

}

void test(int a, char b, double

C .

{

cout<

}

点击查看答案

第5题

下列程序中,分别计算1,2,3......,10的阶乘,并输出计算结果,请将程序补充完整。 程序运行结果如下:

下列程序中,分别计算1,2,3......,10的阶乘,并输出计算结果,请将程序补充完整。

程序运行结果如下:

1!=1

2!=2

3!=6

4!=24

5!=120

6!=720

7!=5040

8!=40320

9!=362880

10!=3628800

public class ex10_1 {

public static void main(String[]args) {

long 1 Factorial;

for(int i=1;i<=10;i++) {

_____________;

for(int j=2;___________;j++)

_____________;

System.out.println(i+ " ! =" + 1Factorial);

}

}

}

点击查看答案

第6题

请将下列程序的横线处补充完整,使得输出结果为bbaainclude<iostream>using namespace std;class

请将下列程序的横线处补充完整,使得输出结果为bbaa

include<iostream>

using namespace std;

class A{

public:

______{cout<<"aa";}

};

class B:public A{

public:

~B(){cout<<"bb";}

};

int main(){

B*p=new

点击查看答案

第7题

下列程序的输出结果为: bjectid=O biectid=1 请将程序补充完整。 include<iostream> using namesp

下列程序的输出结果为:

bjectid=O

biectid=1

请将程序补充完整。

include<iostream>

using namespace std;

class Point

{

public:

Point(int xx=0,int yy=0){X=xx;Y=yy;countP++;}

~Point(){countP--;}

int GetX(){return X;}

int GetY(){return Y;}

static void GetC(){cout<<"Object id="<<countP<<endl;}

private:

int X,Y;

static int countP;

};

______//静态数据成员的初始化

int main()

{

Point::GetC();

Point A(4,5);

A.GetC();

return 0;

}

点击查看答案

第8题

下列程序的输出结果为: 0bject id=0 0biect id=1 请将程序补充完整。 include<iostream> using na

下列程序的输出结果为:

0bject id=0

0biect id=1

请将程序补充完整。

include<iostream>

using namespace std;

class Point

{

public:

Point(int xx=0,int yy=0){X=xx;Y=yy;countP++;}

~Point(){countP--;}

int GetX(){return X;}

int GetY(){return Y;}

static void GetC(){cout<<"0bject id="<<countP<<end1;}

private:

int X,Y;

static int countP;

};

______//静态数据成员的初始化

int main()

{

Point::GetC();

Point A(4,5);

A.GetC();

return 0;

}

点击查看答案
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
温馨提示
每个试题只能免费做一次,如需多次做题,请购买搜题卡
立即购买
稍后再说
警告:系统检测到您的账号存在安全风险

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

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