单项选择题

有如下程序: #include<iostream> using namespace std; class Base{ public: Base(int x=0){cout<<x;} }; class Derived:public Base{ public: Derived(int x=0){cout<<x;} private: Base val; }; int main( ){ Derived d(1); return 0; } 程序的输出结果是

A.0
B.1
C.01
D.001
<上一题 目录 下一题>
热门 试题

填空题
软件需求规格说明书应具有完整性、无歧义性、正确性、可验证性、可修改性等特性,其中最重要的是______。
单项选择题
有如下程序: #include<iostream> using namespace std; class Part{ public: Part(int x=0):val(x){cout<<VAL;}~Part( ){cout<<val;} pritave: int val; }; class Whole{ public: Whole(int x,int Y,int z=0):p2(x),p1(Y),val(z){cout<<val;} ~Whole( ){cout<<val;} pritave: Part p1,p2; int val; f; int main( ){ Whole obj(1,2,3); return 0; } 程序的输出结果是
A.123321
B.213312
C.213
D.123123
相关试题
  • 请将下列栈类Stack补充完整。 class Stac...
  • 有以下复数类的声明,请补充完整。 Class...
  • 请将如下程序补充完整,使得输出结果为:bb...
  • 请在如下程序中的空格处填写正确的语句; ...
  • 有如下程序: #include<iostream> usi...