单项选择题

有如下程序:
#include<iostream>
using name。pace std;
class AA
int n:
public:
AA(int k):n(k)
in 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
<上一题 目录 下一题>
热门 试题

单项选择题
如下程序的输出结果是 #include<iostream> using namespace std; class Test public: Test( )n+=2; ~Test( )n-=3; static int getNum( )return n; private: static int n; ; int Test::n=1; int main( ) Test*P=new Test: delete P; cout<< n= <<Test::getNum( )<<endl; return 0;
A.n=0
B.n=1
C.n=2
D.n=3
单项选择题
有如下程序: #include<iostream> using namespace std; class BASE public: ~BASE( )cout<< BASE ; ; class DERIVED:public BASE public: ~DERIVED( )cout<< DERIVED ; ; int main( )DERIVED x;return 0; 程序的输出结果是
A.BASE
B.DERIVED
C.BASEDERIVED
D.DERIVEDBASE
相关试题
  • 要定义一个具有5个元素的一维数组veer,并...
  • 下列关于运算符重载的叙述中,正确的是
  • 执行语句序列 inti=0;while(i<25)...
  • 已知枚举类型定义语句为: enunl Token ...
  • 下列对于线性链表的描述中正确的是