有如下程序:#includeiostreamusing namespace std;class AA{public:AA(){tout‘l’;}};class BB:public AA{int k;public:BB():k(0){cout…2;}BB(int n):k(n){cout‘3’;}};int main(){BB b(4),C;return 0;}A.1312B.132C.32 D、1412

有如下程序:

#include<iostream>

using namespace std;

class AA{

public:

AA(){tout<<‘l’;}

};

class BB:public AA{

int k;

public:

BB():k(0){cout<<…2;}

BB(int n):k(n){cout<<‘3’;}

};

int main(){

BB b(4),C;

return 0;

}

A.1312

B.132

C.32 D、1412


相关考题:

( 10 )有如下程序:#includeiostreamusing namespace std;class A{public:A(){cout"A" ; }~A(){cout"A" ; }} ;class B {A a;public:B(){cout"B";}~B(){cout"B";}};int main (){B b;return 0;}程序的输出结果是 ___________

有如下程序:includeusing name。pace std;class AA{int n:public:AA(int k):n(k){}in 有如下程序: #include<iostream> using name。pace std; class AA{ int n: public: AA(int k):n(k){} in get( ){return n;} int get( )const{return n+1;} }; int main( ){ AA a(5); const AA b(6); cout<<a.get( )<<b.get( ); return 0: 执行后的输出结果是A.55B.57C.75D.77

请将下列程序的横线处补充完整,使得输出结果为bbaaincludeusing namespace std;class 请将下列程序的横线处补充完整,使得输出结果为bbaainclude<iostream>using namespace std;class A{public:______{cout<<"aa";}};class B:public A{public:~B(){cout<<"bb";}};int main(){B*p=new

有如下程序:include using namespace std;class AA {int n;public:AA(int k):n(k) {} 有如下程序:#include <iostream>using namespace std;class AA { int n;public: AA(int k):n(k) {} int get(){return n;} int get()const { return n+1; }};int main(){ AAa(5); const AA b(6); cout<<a. get()<<b. get(); return ();}执行后的输出结果是( )。A.55B.57C.75D.77

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

请将如下程序补充完整,使得输出结果为:bbaa。 include using naluespace std; class 请将如下程序补充完整,使得输出结果为:bbaa。include<iostream>using naluespace std;class A{public:______{eout<<"aa";}};class B:public A{public:~B( ){eont<<"bb";}};int ulain( ){B*P=new B;delete P;return 0;}

有如下程序: 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;}程序的输出结果是______。

有如下程序:includeusing namespaee std;class AA{public:AA( ){cout 有如下程序: #include<iostreanl> using namespaee std; class AA{ public: AA( ){cout<<'1';} }; class BB:public AA{ int k; public: BB( ):k(0){eout<<'2';} BB(int n):k(n){cout<<'3';} }; int main( ){ BB,b(4),c; return 0; } 程序的输出结果是A.1312B.132C.32D.1412