有如下程序: #includeiostream usingnamespacestd; classC1{ public: ~C1( ){cout1;) }; classC2:publicC1{ public: ~C2( ){cout2;) }; intmain( ){ C2cb2; C1*cb1: return0; } 运行时的输出结果是( )。A.121B.21C.211D.12

有如下程序: #include<iostream> usingnamespacestd; classC1{ public: ~C1( ){cout<<1;) }; classC2:publicC1{ public: ~C2( ){cout<<2;) }; intmain( ){ C2cb2; C1*cb1: return0; } 运行时的输出结果是( )。

A.121

B.21

C.211

D.12


相关考题:

( 31 )有如下程序:#includeiostreamusing namespace std;class C1{public:~C1(){ cout1; }};Class C2: public c1{public:~c2(){ cout2; }};int main(){C2 cb2;C1 *cb1;return 0;}运行时的输出结果是A ) 121B ) 21C ) 211D ) 12

若有如下程序:includeusing namespace std;class TestClass{public:void who(){cout 若有如下程序: #include<iostream> using namespace std; class TestClass { public: void who(){cout<<“TestClass”<<endl;} }; class TestClassl:public TestClass { public: void who(){cout<<“TestClassl”<<endl; int main() { TestCA.TestClasslB.TestClassC.0D.无输出

有如下程序:#includeiostreamusing namespace std;class C1{public:-Cl()}cout1;}};class C2:public C1{public:~c2(){cout2;}};int main(){C2 cb2;C1*cbl:return 0;{运行时的输出结果是A.121B.21C.211 D、12

有如下程序:includeusing namespace std;class BASE{public:~BASE( ){cout 有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE( ){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED( ){cout<<"DERIVED";} }; int main( ){DERIVED x;return 0;} 程序的输出结果是A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE

有如下程序: include using namespace std; class PARENT { public: PARENT() { cout 有如下程序:include <iostream>using namespace std;class PARENT{public:PARENT() { cout <<"PARENT"; }};class SON : public PARENT{public:SON() {cout << "SON"; }};int main(){SON son;PARENT *p;p = son;return 0;}执行上面程序的输出是______。

有如下程序:include using namespace std;class AA{public: virtual void f() {cout 有如下程序: #include <iostream> using namespace std; class AA { public: virtual void f() { cout<< "AA"; } }; class BB : public AA { public: BB() { cout << "BB"; } }; claA.AAB.AABBCCC.BBAABBCCD.BBBBAACC

有如下程序:includeusing namespace std;class C1{public:~Cl( ){cout 有如下程序: #include<iostream> using namespace std; class C1{ public: ~Cl( ){cout<<1;} }; class C2:public C1{ public: ~C2( ){cout<<2;} }; int main( ){ C2 cb2; C1*cb1: return 0; } 程序的输出结果是A.121B.21C.211D.12

2、类class C1的说明如下,错误的语句是() class C1{ int a;//(a) void //(b) public: C1(int val);//(c) ~C1();//(d) };A.aB.bC.cD.d

类class C1的说明如下,错误的语句是() class C1{ int a;//(a) void //(b) public: C1(int val);//(c) ~C1();//(d) };A.aB.bC.cD.d