运行下列程序时的输出结果是( )。#includeusing namespace std;class MyClassA{protected: int n;public: MyClassA(int t) { n=t;} void print() { cout<
A. 12
B. 21
C. 112
D. 121
查看答案
运行下列程序时的输出结果是( )。#includeusing namespace std;class MyClassA{public: MyClassA( ) { cout<<"A";}};class MyClassB:public MyClassA{public: MyClassB( ) { cout<<"B";}};class MyClassC:virtual private MyClassA{public: MyClassC( ) { cout<<"C";}};class MyClassD:protected MyClassC,MyClassB{public: MyClassD( ) { cout<<"D";}};int main(void ){ MyClassD t; system("pause"); return 0;}
ACBD
B. ABACD
C. ACABD
D. ABCD
运行下列程序时的输出结果是( )。#includeusing namespace std;class MyClassA{protected: int a;public: MyClassA(int x=1){a=x;} virtual void print() { cout<
A. 11
B. 112
C. 121
D. 1212
A. 12121
B. 11212
C. 12112
D. 121212
A. 96
B. 236
C. 95
D. 235