有如下程序: #includeiostream usingnamespacestd; classA { public: A(){cout"A";} ~A(){cout"~A";} }; classB { A*P: public: B(){cout"B";p=newA;} ~B(){cout"~B";deleteP;} }; intmain() { Bobi; return0; } 执行这个程序的输出结果是( )。A.BAA~A~B~AB.ABA~B~A~AC.BAA~B~A~AD.ABA~A~B~A

有如下程序: #include<iostream> usingnamespacestd; classA { public: A(){cout<<"A";} ~A(){cout<<"~A";} }; classB { A*P: public: B(){cout<<"B";p=newA;} ~B(){cout<<"~B";deleteP;} }; intmain() { Bobi; return0; } 执行这个程序的输出结果是( )。

A.BAA~A~B~A

B.ABA~B~A~A

C.BAA~B~A~A

D.ABA~A~B~A


相关考题:

有如下程序: 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”;} }; A*p; public: B(){cout<<“B”;p=new A;} ~B(){cout<<“~B”;delete p;} }; B obj; return 0; ) 执行这个程序的输出结果是(A.BAA~A~B~AB.ABA~B~A~AC.BAA~B~A~AD.ABA~A~B~A

有如下程序: include using namespace std; class A { public: 有如下程序: #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(){Cobj;retum 0;} 执行后的输出结果是A.CBAB.BACC.ACBD.ABC

有如下程序:includeusing namespace std;classA{public:A(){cout 有如下程序: #include<iostream> using namespace std; classA { 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.ABCB.BACC.ACBD.CBA

请将如下程序补充完整,使得输出结果为:bbaa include using namespace std; class A { 请将如下程序补充完整,使得输出结果为:bbaainclude <iostream>using namespace std;class A {public:【 】{cout << "aa"; }};class B: public A{public:~B(){ cout << "bb"; }};int main () {B *p= new B;delete p;return 0;}

如下程序的输出结果是includeusing 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

有如下程序:includeusing 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

有如下程序: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

有如下程序: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 有如下程序: #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