#include
using namespace std;
class Base{
protected;
B.ase(){cout<<’A’;}
B.ase(char c){cout<};
class Derived; public Base{
public:
D.erived(char c ){cout <};
int main(){
D.erived d1(‘B’);
return 0;
}
执行这个程序屏幕上将显示输出______。
A.B
B.BA
C.AB
D.BB
[单选题]有以下程序:inClUdeusingnamespacestd;ClassBase{public: Base(intx) {a=x; } voidsh有以下程序: #inClUde <iostream> using namespace std; Class Base { public: Base(int x) { a=x; } void show() { cout<<a; } private: int a; }; class Derived : public Base { public: Deri
[单选题]有如下程序#includeusing namespace std;class Obj{static int i;public:Obj(){i++;}~Obj(){i--;}static int getVal(){teturn i;}};int Obj::i=0;void f (){Obj ob2;coutObj obl;F.();Obj*ob3=new Obj;coutD.elete ob3;cout}程序的输出结果是______。A.232B.231C.222D.221
[单选题]有如下程序:includeusingnamespacestd;classXX{protected: intk;public: XX(intn=5):有如下程序: #include <iostream> using namespace std; class XX { protected: int k; public: XX(int n=5):k(n){} ~XX() { cout<<"XX"; } virtual void f() const=0; }; inline void XX::f()
[单选题]有如下程序#include#includeusing namespace std;int main(){count<<12,345<<&NBSP;<<34,567;return 0;}若程序的输出是:**12.345**34.567则程序中下划线处遗漏的操作符是______。A.setprecision(3)B.fixedC.setfill(*)D.stew(8)
[单选题]有如下程序#include#includeusing namespace std;class MyClass{public:MyClass(){cout<<’A”;}MyClass(char c {cout<~MyClass(){sout<<’B”;}};Int main(){MyClassp1,*p2p2=new MyClass(‘X’);delete p2;return 0;}执行这个程序幕上将显示输出______。A.ABXB.ABXBC.AXBD.AXBB
[单选题]有如下程序#includeusing namespace std;class A{public:virtual Void funcl(){cout<< “A1”;}void fune2(){cout<< “A2”;}};class B: public A{public:void func1(){cout<< “B1”;}void func2(){cout<< “B2”;}};Int main(){A.*p=new B;p->funcl();p
[单选题]有如下程序#includeusing namespace std;int i=1;class Fun{public;static int i;int value(){return i-1}int value ()const{return i+1;}};int Fun;;i=2;int main(){int i=3;F.un Fun1const Fun fun2;return 0;}若程序的输出结果是:123则程序中下划线处遗漏的语句是______。A.cout<B.cout<C.co