单项选择题

有下列程序: #include<iostream> using namespace std; class VAC{ public: int f() const{return3;} int f() {return 5;} }; int main(){ VAC v1; const VAC v2; cout<<v1.f()<<v2.f(); return 0; } 运行该程序的输出结果是( )。

A.53
B.35
C.55
D.33
<上一题 目录 下一题>
热门 试题

单项选择题
有下列程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void fimction(double val) { val=3; } 编译运行这个程序将出现的情况是( )。
A.编译出错,无法运行
B.输出3
C.输出:3.0
D.输出一个不确定的数
单项选择题
有下列程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<< printl <<endl; } void print ()const { cout<< print2 <<endl; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 运行该程序后的输出结果是( )。
A.print1
B.print2
C.pfint1 print2
D.程序编译时出错
相关试题
  • 在声明派生类时,如果不显式地给出继承方式...
  • 已知下列程序的输出结果是42,请将横线处...
  • 有下列程序:#include<iostream>using ...
  • 在类的对象被创建时,______函数会被...
  • 请将下列类定义补充完整。class Base{pub...