以下程序的执行结果为______。include class A {public:A(){cout 以下程序的执行结果为______。include<iostream.h>class A{public:A(){cout<<“a”;}~A(){cout<<“b”;}};class B:public A{public:B(){cout<<“c”;)~B(){cout<<“d”;}};void main(){B b;}

以下程序的执行结果为______。include class A {public:A(){cout<<“a”;} ~A(){cout<<

以下程序的执行结果为______。

include<iostream.h>

class A

{public:A(){cout<<“a”;}

~A(){cout<<“b”;}};

class B:public A

{public:

B(){cout<<“c”;)

~B(){cout<<“d”;}};

void main()

{B b;}


相关考题:

在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。 include using nam 在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;classA{public:A(){cout<<'A';}};class B:______{public:B(){cout<<'B';}};class C:______{public:C(){cout<<'C';}};class D:public B,public C{public:D(){cout<<'D';}};void main(){D obj;)

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

有如下程序:includeusing namespace std;Class Base{public:Base(){cout 有如下程序: #include<iostream.h> using namespace std; Class Base { public: Base(){cout<<“BB”;f();} void{(){cout<<“BF”;} }; class Derived:public Base { public: Derived(){cout<<“DD”;} void f(){cout<<“Df”;) }; int mainA.BBBfDDB.BBDfDDDfC.DDD.DDBBBf

以下程序的执行结果为______。include using namespace std; class base { public: vir 以下程序的执行结果为______。include<iostream>using namespace std;class base{public:virtual void who(){cout<<"base class"<<endl;}};class derivel:public base{public:void who(){cout<<"d

下面程序的结果是includeclass A{public: A(){cout 下面程序的结果是 #include<iostream.h> class A { public: A(){cout<<"construtA" <<endl;} virtual ~A() {cout << "destructA" <<endl;}}; class B:public A { }; class C:public A { }; class D:public B,public C { }; void main() { Dd;}A.constructAB.constructAC.constmctAD.constmctA destructA constructA constmctA constructA destructA constructA constructA destructA destructA constructA destructA dest

在下面程序的画线处填上适当的内容,使程序执行后的输出结果为ABCD。 include using 在下面程序的画线处填上适当的内容,使程序执行后的输出结果为ABCD。include <iostream>using namespace std;class A{public:A( ){cout<<'A';}};class B: (11) {public:B( ){cout<<'B';}{;class C: (12) {public:C( ){cout<<'C';}};class D:public B,public C{public:D( ){cout<<'D';}};void main( ){D( );cout<<endl;}

下面程序的运行结果是()。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 class A { public: virtual void use( ) {cou 下列程序的运行结果是______。include<iostream.h>class A{public:virtual void use( ) {cout<<"in A\n";}};class B:public A{public:virtual void use( ) {cout<<"in B\n";}};class C:public B{public:virtual void use( ){cout"in C\n";}};void main( ){A*obj;bj=new C;obj->use( );delete obj;}

下面程序的结果是includeclass A{public:A( ){cout 下面程序的结果是 #include<iostream.h> class A { public: A( ) {cout<<"construtA"<<endl;} virtual~A( ) {cout<<"destructA"<<endl;}}; class B:public A {}; class C:public A {}; cA.constructA destructAB.constructA constructA destructA destructAC.constructA constructA constructA destructA destructA destructAD.constructA onstructA constructA constructA destructA destructA destructA destructA

有如下程序:include using namespace std;class Base{public:Base(){ cout 有如下程序: #include <iostream.h> using namespace std; class Base { public: Base(){ cout<<"BB"; f(); } voidf(){cout <<"Bf"; } }; class Derived: public Base { public: Derived (){cout<<"DD";} void f(){cout<<"Df";} }; int main(){Derived d; return 0;} 执行上面的程序将输出A.BBBfDDB.BBDfDDDfC.DDD.DDBBBf

下列程序的运行结果是______。include class Base { public: void f(int x){cout 下列程序的运行结果是______。include<iostream.h>class Base{public:void f(int x){cout<<“Base:”<<x<<endl;});class Derived:public Base{public:void f(char*str){cout<<“Derived:”<<str<<endl;}};void main(void){Base*pd=ne

以下程序的执行结果是______。 include class A{ int a: public: void seta(int x) { 以下程序的执行结果是______。include<iostream.h>class A{int a:public:void seta(int x) {a=x;}void showa() {cout<<a<<end1;}};class B{int b;public:void setb(int x) {b=x;}void showb(){cout<<b<<end1;}};

以下程序的执行结果是______。 include class base { public: virtual void who(){c 以下程序的执行结果是______。include<iostream.h>class base{public:virtual void who(){cout<<"base class"<<endl:}};class derrvel:public base{public:void who(){cout<<"derivel class"<<endl:}};class derive2;public base{public:void who() {cout<<"derive2 class"<<endl;}};void main(){base obj1,*P;derive1 obj2;derive2 obj3:p=obj1;p->who();p=obj2:p->who();p=obj3;p->who();}

在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 include usingn 在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。include <iostream.h>using namespace std;class A{public: A() {cout<<'A';};class B:______{public: B() {cout<<'B';}};class C:______{public: C(} cout<<'C';}};class D:public B, public C{public: D(){cout<<'D';}};void main(){D obj;}

有以下程序: include class A { intx; public: A(int a) { x=a;} friend class B; 有以下程序:include<iostream.h>class A{int x;public:A(int a){x=a;}friend class B;}class B{public:void print(A a){a. x--;cout<<a.x<<end1;}};void main(){A a(10);B b;b.print(a) ;}程序执行后的输出结果是【 】。

下面程序的运行结果为( )。 #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.1234B.1324C.1342D.3142

下面程序的运行结果为 include class A { public: A( ) {cout 下面程序的运行结果为#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.1234B.1324C.1342D.3142

以下程序执行结果是 ( )。include class Base{public virtual void fun() {cout 以下程序执行结果是 ( )。 #include <iostream.h> class Base { public virtual void fun() { cout<<"B"; } }; class Derived { public: Derived() { cout<<"D"; } virtual void fun(){ Base::fun(); cout<<"C"; } } int main () { Base *ptr; Derived obj; ptr=obj; p->fun ( ); return 0; }A.DBCB.DCBC.BDCD.CBD

下面程序的结果是includeclass A { int a;public: A():a(1){} void showa(){cout 下面程序的结果是 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; class B { int a; public: B():a(2){} void showa(){cout<<a;} }; class C:public A,public B { int a; public: C():a(3) ㈠ voidshowa(){cout<<a;} }; voidmain() { C c; c.showa(); }A.1B.2C.3D.程序有错误

下面程序的运行结果为( )。 include using namespace std; class A{ pu 下面程序的运行结果为( )。 #include <iostream> using namespace std; class A{ public: A(){cout<<" ";} ~A(){cout<<" ";} } class B:public A{ public: B(){cout<<" ";} ~B(){cout<<" ";} } void main(){ B b; }A.1234B.1324C.1342D.3142

有以下程序:include using namespace std;class A{public: virtual void show() {cout 有以下程序:include <iostream>using namespace std;class A{public:virtual void show(){cout<<"A";}};class B : public A{public:void show(){cout << "B";}};void display( A * obj ){obj-> show();}int main ( ){A demol;B demo2;display( demol );display( demo2 );return 0;}执行后的输出结果为【 】。

下面程序的结果是()。includeclass A{int a;public:A():a(1){}void showa(){cout 下面程序的结果是( )。 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; Class B { int a; public: B():a(2){} void showa(){cout<<a;} ); class C:public A,public B { int a; puA.1B.2C.3D.程序有错误

下面程序的运行结果为includeclass A{public: A( ){cout 下面程序的运行结果为 #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( ) { BA.1234B.1324C.1342D.3142

有如下程序:include using namespace std;class A {public: A() {cout 有如下程序: #include <iostream> using namespace std; class A { public: A() {cout<<"A";} }; class B {public:B() {cout<<"B";}}; class C: public A { Bb; public: C() {cout<<"C";} }; int main() {C obj;return 0;}执行后的输出结果是 ______。A.CBAB.BACC.ACBD.ABC

以下程序执行后的输出结果是 ( )。include class Basel{public: void fun(){ cout 以下程序执行后的输出结果是 ( )。 #include <iostream.h> class Basel { public: void fun(){ cout<<"Basel"<<end1; } }; class Base2 { public: void fun() { cout<<"Base2"<<end1; } } class Derived : public Basel,public Base2 { }; void main() { Derived Obj; Obj.fun(); }A.BaselB.Base2C.BaselBase2D.程序产生二义性

有如下程序:include using namespace std;class A{public:A(){cout 有如下程序: #include <iostream> using namespace std; class A { public: A(){cout<<"A";} }; class B {public:B(){cout<<"B";} }; class C:public A { B b; public:C(){cout<<"C";} }; int main(){C obj;return 0;} 执行后的输出结果是( )。A.CBAB.BACC.ACBD.ABC

在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。 include using nam 在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。include<iostream>using namespace std;class A{public: A(){cout<<'A';}};class B:【 】{public:B(){cout<<'B';)};class C:【 】{public;C(){cout<<'C';}};class D:public B,public C{public:D(){cout<<'D';}};void main(){D obi;}