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

有如下程序:includeusing namespace std;class A{public: A(){cout<<"A";}};classB{p

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

A.CBA

B.BAC

C.ACB

D.ABC


相关考题:

有如下程序: include using namespace std; class A { public: virtual void f(){cout 有如下程序:include<iostream>using namespace std;class A{public:virtual void f(){cout<<"1";}};class B:public A{public:B (){cout<<"2";}};class C:public B{public:virtual void f(){B::f();cout<<"3";}};int main(){A aa,*p;B bb;C cc;p=cc;p->f();return 0;}执行上面程序的输出是______。

有如下程序:includeusing namespace std;class A{public:A(){cout 有如下程序: #include<iostream> using namespace std; class A { public: A(){cout<<"A";} ~A(){cout<<"~A";} }; class B:public A { A*p; public: B(){cout<<"B";p=new A;} ~B(){cout<<"~B";delete p;} }; int main() { B obj; return 0; } 执行这个程序的输出结果是( )。A.BAA~A~B~AB.ABA~B~A~AC.BAA~B~A-~AD.ABA~A~B~A

下面程序输出的结果为 #include"iostream.h" class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASSB"<<endl;} ~B() {} }; void main() { A * p; p=new B; B *q; q=new B; }A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B

下面程序输出的结果为#include"iostream.h"class A{public:A( ){cout<<"CLASS A"<<endl;}~A( ){}};class B:public A{public:B( ){cout<<"CLASS B"<<endl;}~B( ){}};void main( ){A*p;p=new B;B *q;q=new B;}A.CLASS A CLASS BB.CLASS A CLASS B CLASS BC.CLASS A CLASS B CLASS A CLASS BD.CLASS A CLASS B CLASS B CLASS B

有如下程序: include using namespace std; class A { public: A(){cout 有如下程序: #include<iostream> using namespace std; class A { public: A(){cout<<"A";} ~A(){cout<<"~A";) }; class B:public A { A*p; public: B(){cout<<"B";p=new A;} ~B(){cout<<"~B";delete p;} }; int main() { B obj; return 0; } 执行这个程序的输出结果是( )。A.BAA~A~B~AB.ABA~B~A~AC.BAA~B~A~AD.ABA~A~B~A

有如下程序: include using namespaee std; class A{ public: A( ){cout 有如下程序:include<iostream>using namespaee std;class A{public:A( ){cout<<"A";}~A( ){cout<<"A";}};class B{A a;public:B( ){cout<<"B";}~B( )t cout<<"B";}};int main( ){B b;return 0;}程序的输出结果是______。

下面程序输出的结果为( )。 #include"iostream.h" classA {public: A(){cOUt"CLASSA"endl;} ~A(){}}; ClaSSB:publicA {public: B(){cout"CLASSB"endl;} ~B(){}}; voidmain() {A*P; P=newB: B*q: q=newB;}A.CLASSAB.CLASSA CLASSBCLASSB CLASSBC.CLASSAD.CLASSA CLASSBCLASSB CLASSACLASSB CLASSBCLASSB

下面程序输出的结果为 #include"iostream.h” class A { public: A(){cout<<"CLASSA"<<endl;} ~A() {} }; class B:public A { public: B(){cout<<"CLASS B"<<endl;} ~B(){} }; void main() { A*p; p=new B;A.CLASS A CLASS B CLASS B CLASS BB.CLASS A CLASS B CLASS A CLASS BC.CLASS A CLASS B CLASS BD.CLASS A CLASS B

有如下程序:includeusing namespace std;class B{public:Virtual void show(){cout 有如下程序: #include<iostream> using namespace std; class B{ public: Virtual void show(){cout<<“B”;} }; class D:publicB{ public: void show(){cout<<“D”;} }; void funl(B*ptr){ptr->show();} void{un2(Bref){ref.show();} voidA.BBBB.BBDC.DBBD.DBD

有如下程序:includeusing namespace std;class A{public:A(){cout 有如下程序: #include<iostream> using namespace std; class A { public: A(){cout<<'A';) ~A(){cout<<"~A";) }; class B:public A { A* p; publiC: B(){cout<<"B"; p=new A();) ~B(){cout<<"~B";delete p;) }; int main() { B obj; return 0; } 执行这个程序的输出结果是( )。A.BAA~A~B~AB.ABA~B~A~AC.BAA~B~A~AD.ABA~A~B~A