下面程序的运行结果是#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(){ 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.0123

B.3120

C.0312

D.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;}

有以下程序 include using namespace std; class Base { int a; public: Base(int x) 有以下程序include <iostream>using namespace std;class Base{int a;public:Base(int x){ a=x; }void show(){ cout<<a; }class Derived : public Base{int b;public:Derived(int i) :Base(i+1),b(i){}void show() { cout<<b;};int main (){Base b(5),*pb;Derived d(1);pb=d;pb->show ();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

下面程序的打印结果是【】。 include using namespace std; class Base { public:Base(i 下面程序的打印结果是【 】。include <iostream>using namespace std;class Base{public:Base(int x){a=x;}void show(){cout<<a;}private:int a;};class Derived : public Base{public:Derived(int i) :Base(i+1) ,b(i) { }void show(){cout<<b;}private:int b;};int main ( ){Base b(5) , *pb;Derived d(1);pb=d;pb->show();return 0;}

下面程序的运行结果是( )。 #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