单项选择题
有如下程序:
#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
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
下面是类Shape的定义: class Shape public: virtual void Draw()=0; 下列关于Shape类的描述中,正确的是( )。
A.类Shape是虚基类
B.类Shape是抽象类
C.类Shape中的Draw函数声明有误
D.语句“Shape s;”能够建立Shape的一个对象s
点击查看答案&解析
单项选择题
下列函数的运行结果是( )。 #include<iostream.h> int f(int a,int b) int c; if(a>b)c=1; else if(a==b)c=0; else c=-1; return(c); void main() int i=2,j=3; iht p=f(i,j); cout<<p;
A.-1
B.1
C.2
D.编译出错,无法运行
点击查看答案&解析
相关试题
多数运算符既能作为类的成员函数重载,也能...
补充完整下面的类定义: class XCH char...
若下列程序运行时输出结果为 1,A,10...
下列程序将x、y和z按从小到大的顺序排列,...
下列程序编译错误,因为add函数返回值是一...