单项选择题

有如下程序:
#include<iostream>
using namespace std;
class A
public:
A()cout<<"A";
;
classBpublic:B().cout<<"B";
classC:public A
B b;
public:
C()cout<<"C";
;
int main() C obj; return 0;
执行后的输出结果是

A.CBA
B.BAC
C.ACB
D.ABC
<上一题 目录 下一题>
热门 试题

单项选择题
若有如下程序: #include<iostream> using namespaces std; int s=0; class sample static int n; public: sample(int i) n=i; static void add() s+=n; ); int sample::s=0; int main() sample a(2),b(5); sample::add(); cout<<s<<endl; return 0; 程序运行后的输出结果是
A.2
B.5
C.7
D.3
单项选择题
有如下程序: #include<iostream> using namespace std; class AA int n; public: AA(int k):n(k) int get()return n;) int get()constreturn n+1; ; int main() AA a(5); const AA b(6); cout<<a.get()<<b.get(); return 0; 执行后的输出结果是
A.55
B.57
C.75
D.77
相关试题
  • 下列程序的输出结果为2,请将程序补充完整...
  • 下列程序的输出结果是______。 #in...
  • ______允许用户为类定义一种模式,使...
  • 以下函数模板max()的功能是:返回数组a中...
  • 派生类中的成员不能直接访问基类中的___...