首页 > 职业考试题库1 > 题目详情
有如下程序: #include using namespace std; cla
题目内容:
[单选题]有如下程序: include using namespace std; class Base1{ public: Base1(int D){cout有如下程序:
#include<iostream>
using namespace std;
class Base1{
public:
B.ase1(int D){cout<<d;}
~Base1(){}
};
class Base2{
public:
B.ase2(int D){cout<<d;}
~Base2 (){}
};
class Derived:public Base1, Base2{
public:
D.erived(int a, int b, int c, int D) ;
B.ase1(B), Base2(
A.), b1(D), b2(C){}
Private:
int b1;
int b2;
};
int main(){
D.erived d(1, 2, 3, 4);
return 0;
}
运行时的输出结果是( )。A) 1234
B.) 2134
C.) 12
D.) 21
A.
B.
C.
D.
有如下程序:
#include<iostream>
using namespace std;
class Base1{
public:
B.ase1(int D){cout<<d;}
~Base1(){}
};
class Base2{
public:
B.ase2(int D){cout<<d;}
~Base2 (){}
};
class Derived:public Base1, Base2{
public:
D.erived(int a, int b, int c, int D) ;
B.ase1(B), Base2(
A.), b1(D), b2(C){}
Private:
int b1;
int b2;
};
int main(){
D.erived d(1, 2, 3, 4);
return 0;
}
运行时的输出结果是( )。A) 1234
B.) 2134
C.) 12
D.) 21
A.
B.
C.
D.
本题链接: