有如下程序: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
有如下程序:includeusing namespaee std;class AA{public:AA( ){cout<<'1';}};class
有如下程序: #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.1312
B.132
C.32
D.1412
相关考题:
请将下列程序的横线处补充完整,使得输出结果为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 AA {int a;public: AA() 请分析下面的程序并给出该程序的执行结果【 】。include <iostream>class AA {int a;public:AA() {cout<<" Initializing AA!\n" ; }AAM() {cout<<" Destroying AA!\n" ;};class BB {int b;AA p;public:BB() {cout<<"Initializing BB!\n" ;~BB() {cout<<"Destroying BB!\n" ;};void main() {BB X;cout<<"Ending main!\n' ;}
有以下程序: 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;}程序的输出结果是______。
有如下程序: inClude using namespace std; class AA { public: viltual void f() { c 有如下程序:inClude<iostream>using namespace std;class AA{public:viltual void f(){cout<<"AA";}};class BB:public AA{public:BB(){cout<<"BB";}};class CC:public BB{public:virtual void f(){BB::f();cout<<"CC";}};int main(){AA aa,*p;BB bb;CC cc;p=cc;p->f();return 0;}运行后的输出结果【 】。
下面程序的结果是 ______。includeclass A{ public:virtual voidfun()=0{};};class 下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun()=0{}; }; class B:public A{ public: void fun () {cout<< "new file" ;} }; class C: public A{ public: void fun (){cout<<"open file"<< " " } }; class D: public A{ public: void fun () {cout<< "save file\n" ;} }; void main() { A a,*p; B b; C c; D d; p=c; p->fun (); p=b; p->fun (); p=d; p->fun(); }A.new file open file save fileB.new file new file new fileC.编译出错D.open file new file save file