
有如下程序: #include<iostream> using namespace std; class A { public:
A.CBA
B.BAC
C.ACB
D.ABC

A.CBA
B.BAC
C.ACB
D.ABC
有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是
A.###123
B.123###
C.***123
D.123***
有如下程序: #include <iostream> using namespace std; int main(){ cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0;} 执行后的输出结果是
A.###123
B.123###
C.***123
D.123***
有如下程序: #include<iostream> using namespqce Std; class TestClass { private; Char C; public; TestClass(char n):c(n){} ~TestClass() { cout<<c; }; class TestClassl:public TestClass { private: Char C; public:
A.xy
B.yx
C.x
D.y
有如下程序: #include<iostream.h> using namespace std; Class Base { public: Base(){cout<<“BB”;f();} void{(){cout<<“BF”;} }; class Derived:public Base { public: Derived(){cout<<“DD”;} void f(){cout<<“Df”;) }; int main
A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
有如下程序: #include<iostream> using namespace std; Class TestClass { private: int x,y; public: TestClass(int i,int j) { x=i; y=j; } void print() { cout<<“print1”<<endl; } void print()const { cout<<”prin
A.printl
B.print2
C.printl print2
D.程序编译时出错。
有如下程序: #include<iostream> using namespace std; classA{ public: virtua1 voidfunc1(){cout<<“A1”;} voidfunc2(){cout<<“A2”;}}; class B:publicA{ public: void funcl(){cout<<“B1”;} void func2(){cout<<“B2”;}}; intmain(){ A*p=ne
A.B1B2
B.A1A2
C.B1A2
D.A1B2
有如下程序: #include<iostream> using namespace std; Class A { public: A(){cout<<“A”;} ~A(){cout<<“~A”;} }; A*p; public: B(){cout<<“B”;p=new A;} ~B(){cout<<“~B”;delete p;} }; B obj; return 0; ) 执行这个程序的输出结果是(
A.BAA~A~B~A
B.ABA~B~A~A
C.BAA~B~A~A
D.ABA~A~B~A
有如下程序: #inClude<iostream> using namespace std; Class TestClass {public: virtUal void furll() {cout<<“funlTestclass”;} virtual void fun2() {cout<<“{fun2TestClass”;}}; class TestClassl:public TestClass {void fun() {cout<<“fu
A.fun1TestClass1 fun2TestClass
B.fun1TestClass1 fun2TestClass1
C.fUnlTestClass fun2TestClass
D.funlTe3tClass fun2TestClassl
有如下程序: #include<iostream> using namespace std; long fun(int n) { if(n>2) return(fun(n-1)+fun (n-2)); else return 2; } int main() { cout<<fun(3)<<end1; return 0; } 则该程序的输出结果应该是 ()。
A.2
B.3
C.4
D.5
有如下程序: #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;
A.n=0
B.n=1
C.n=2
D.n=3