网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有如下程序: #include<iostream> usingnamespacestd; classCon charID; public: Con():ID(A){cout<<1;} Con(charID):ID(ID){eout<<2;} Con(Con&c):ID(c.getID()){cout<<3;} chargetID()corlst{returnID;} }; voidshow(Conc)(cout<<C.getID();} intmain() { Conc1:
show(c1); Conc2(B); show(c2); return0; } 执行上面程序的输出是( )。
A.13A23A
B.23A13B
C.13A23B
D.13823A
参考答案
更多 “ 有如下程序: #includeiostream usingnamespacestd; classCon charID; public: Con():ID(A){cout1;} Con(charID):ID(ID){eout2;} Con(Con&c):ID(c.getID()){cout3;} chargetID()corlst{returnID;} }; voidshow(Conc)(coutC.getID();} intmain() { Conc1:show(c1); Conc2(B); show(c2); return0; } 执行上面程序的输出是( )。A.13A23AB.23A13BC.13A23BD.13823A ” 相关考题
考题
有如下程序:#includeusing namespace std;class Con{char ID;public:Con():ID('A'){cout1;}Con(char ID . :ID(ID . {cout2;}Con(ConC . :ID(c.getID()){cout3;}char getID() const{return ID;}};void show(ConC . {coutint main(){Con c1;show(c1);Con c2('B');show(c2);return 0;}执行上面程序的输出是 【 10 】 。
考题
有如下程序:includeusing namespace std;class Con{char ID;public:Con():ID('A'){co
有如下程序: #include<iostream> using namespace std; class Con { char ID; public: Con():ID('A'){cout<<1;} Con(char ID):ID(ID'){cout<<2;} Con(Conc):ID(c.getID()){cout<<3;} char getID()const{returnID;} }; void show(Con c){toA.13A23AB.23A13BC.13A23BD.13B23A
考题
若有如下程序: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.无输出
考题
有如下程序: 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
考题
有如下程序: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
考题
有如下程序: #include(iostream usingnamespacestd; classCon { charID; public: Con( ):ID('A){cout1;} Con(charID):ID(ID){cout((2;) Con(Con8Lc):ID(c.getlD( )){cout3;} chargetID( )const{returnID;} }; voidshow(Conc){coutC.getlD( );} intmain( ) { Conc1; show(c1); Conc2('B'); show(c2); return0; 执行上面程序的输出结果是( )。A.13A23AB.23A13BC.13A23BD.13823A
热门标签
最新试卷