单项选择题

下面程序输出的结果是( )。
#include<iostream>
using namespace std;
class A
int X;
public:
A(int x):x(++x)
~A()cout<<x;
;
class B:public A
int y;
public:
B(int y):A(y),y(y)
~B()cout<<y;;
;
void main()
B b(3);

A.34
B.43
C.33
D.44
<上一题 目录 下一题>
热门 试题

单项选择题
根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person int age; voidtest() public: Person(intage)this->age=age; void ShowAge()cout<< the Person’s age is ,<<age; ; void main() Person wang(23);
A.wang.age=45
B.wang.wang(45)
C.wang.ShowAge()
D.wang.test()
单项选择题
如果只想得到1024个元素组成的序列中第5个最小元素之前的部分排序的序列,用 ( )方法最快。
A.冒泡排序
B.快速排序
C.简单选择排序
D.堆排序
相关试题
  • 下面程序执行的结果是 【14】 #includ...
  • 下面程序执行的结果是 【15】 。 #in...
  • 虚基类是含有 【13】 函数的类。
  • 面向对象的基本特点包括继承性、封装性和 ...
  • C++源程序中,只有 【12】 个主函数。