单项选择题
有以下程序:#include <iostream>using namespace std;class A{public: A(int i,int j) { a=1; b=j; } void move (int x,int y) { a+=x; b+=y; } void show() cout<<a<<","<<b<<end1 } private: int a,b; }; class B : private A { public: B(int i,int 3):A (i,j) {} void fun() { move (3,5); } void f1() { A::show(); } }; int main() { B d(3,4); d.fun(); d.f1(); return 0; } 程序执行后的输出结果是
A.3,4
B.6,8
C.6,9
D.4,3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序:#include <iostream>using namespace std:class Test{public: Test() {n+=2; ~Test() {n-=3; ; static int getNum() {return n;}privaue: static int n:};int Test::n=1;int main(){ Test* p=new Test; delete p; cout<< n= <<Test::getNum()<<end1; return 0;} 执行后的输出结果是
A.n=0
B.n=1
C.n=2
D.n=3
点击查看答案&解析
单项选择题
下列虚基类的声明中正确的是
A.class virtual B: public A
B.virtual class B: public A
C.class B: public A virtual
D.class B: virtual public A
点击查看答案&解析
相关试题
B
有如下程序: #include <iostream.h>...
B