网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下面程序的运行结果是( )。
#include<iostream.h>
classbase{
protected:
inta;
public:
base(){cout<<"0";}
};
classbasel:virtualbase{
public:
basel(){cout<<"1";}
};
classbase2:virtualbase{
public:
base2(){cout<<"2";}
};
classderived:publicbasel,publicbase2{
public:
derived(){cout<<"3";}
};
voidmain()
{
derivedobj;
cout<<endl;
}
A.0123
B.3120
C.0312
D.3012
参考答案
更多 “ 下面程序的运行结果是( )。#includeiostream.hclassbase{protected:inta;public:base(){cout0;}};classbasel:virtualbase{public:basel(){cout1;}};classbase2:virtualbase{public:base2(){cout2;}};classderived:publicbasel,publicbase2{public:derived(){cout3;}};voidmain(){derivedobj;coutendl;}A.0123B.3120C.0312D.3012 ” 相关考题
考题
下面程序的运行结果是#includeclass base{protected:int a;public:base(){ cout ”0”;}class basel:virtual base}public:base 1(){cout ”1”;}};class base2:virtual base{public:base2(){cout ”2”;(};class derived:public base1,public base2{public:derived(){cout ”3”;}};void main(){derived obj;cout }A.0123B.3120C.0312D.3012
考题
下面程序的运行结果是 include class base{ protected: int a; public: base( ) {c
下面程序的运行结果是#include<iostream.h>class base{protected:int a;public:base( ) {cout < < "0";}};class base l: virtual base{public:base l ( ) {cout < <"1";}};class base 2: virtual base{public:base2 ( ) {cout < <"2";}};class derived: public base 1, public base2{public:derived( ) {cout < < "3";}};void main( ){derive obj;cout < < endl;}A.0123B.3120C.0312D.3012
考题
下面程序的运行结果是()。includeclass base{protected:int a;public:base(){cout
下面程序的运行结果是( )。 #include<iostream.h> class base{ protected: int a; public: base(){cout<<“0”;} }; Class basel:Virtual base{ public: basel(){cout<<“1”;} }; Class base2:virtual base{ public: base2(){cout<<“2”;)A.0123B.3120C.0312D.3012
考题
下面程序的输出结果是【】。include using namespace std; class base { protected: int
下面程序的输出结果是【 】。include <iostream>using namespace std;class base{protected:int a;public:base(){cout<<"0":}};class basel: virtual public base{public:base1(){ cout<<"1";}};class base2 : virtual public base{public:base2(){cout<<"2";}};class derived : public base1,public base2{public:derived () {cout<<"3"; }}int main (){derived obj;cout<<end1;return 0;}
考题
下面程序的运行结果是includeclass base{protected:int a;public:base( ){cout
下面程序的运行结果是 #include<iostream.h> class base{ protected: int a; public: base( ){cout<<"0";} }; class basel:virtual base { public: base1( ){cout<<"1";} }; class base2:virtual base{ public:A.123B.3120C.312D.3012
考题
下面程序运行的结果是()。includeusing namespace std;class A{ protected:int a; pub
下面程序运行的结果是( )。 #include<iostream> using namespace std; class A{ protected: int a; public: void input(int i) {a=i;} }; class B{ protected: int a; public: void input(int j) {a=j;} }; class C: public A, public B { int x; public: void input() {x=A::a * B::a;cout<<x<<endl;} }; void main() { C c; c.A::input(5); c.B::input(8); c.input(); }A.5B.8C.40D.编译出错
考题
下面程序的运行结果是( )。 #includeiostream.h classbase{ protected: inta; public: base(){cout"0";} }; classbasel:virtualbase{ public: basel(){cout"1";} }; classbase2:virtualbase{ public: base2(){cout"2";} }; classderived:publicbasel,publicbase2{ public: derived(){cout"3";} }; voidmain() { derivedobj; eoutendl: }A.0123B.3120C.O312D.3012
考题
下面程序的运行结果是( )。 #includeiostream.h class base{ protected: int a; public: base{cout”0”;} }; class basel:virtual base{ public: basel{cout”1”;} }; class base2:virtual base i public: base2{cout”2”;} }; class derived:public basel,public base2{ public: derived{cout”3”;} }; void main derived obj; coutendl:A.0123B.3120C.0312D.3012
考题
下面程序的运行结果是includeclass base{protected: int a;public: base(){cout
下面程序的运行结果是 #include<iostream.h> class base{ protected: int a; public: base(){cout <<"0";} }; class basel:virtual base{ public: basel () {cout <<"1";} }; class base2:virtual base{ public: base2(){cout <<"2";} }; class derived:public basel,public base2{ public: derived(){cout <<"3";} }; void main() { derived obj; cout <<end1; }A.123B.3120C.312D.3012
热门标签
最新试卷