首页 > 职业考试题库1 > 题目详情
有如下程序: #include using namespace std; cl
题目内容:
[单选题]有如下程序: include using namespace std; class Base { public:有如下程序: #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.1
D.1
有如下程序: #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.1
D.1
本题链接: