有如下程序: #include <iostream> using namespace std; class x { protected: int a; public: x() { a=1; } }; class x1 : virtual public x { public: x1() { a+=1; cout<<a; } };
A.1
B.123
C.242
D.244
[单选题]有如下程序:include using namespace std;class BASE{public:~BASE(){cout<<"BASE";}有如下程序: #include <iostream> using namespace std; class BASE{ public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED(){cout<<"DERIVED";} }; int main(
[单选题]有如下程序:include using namespace std;class Base{public:Base(){ cout<<"BB";有如下程序: #include <iostream.h> using namespace std; class Base { public: Base(){ cout<<"BB"; f(); } voidf(){cout <<"Bf"; } }; class Derived: public Base { public: Derived (){c
[单选题]有如下程序:include using namespace std;class point{intx,y;public:point( int vx,有如下程序:#include <iostream>using namespace std;class point{ int x, y;public: point( int vx, int vy ) { x = vx; y = vy; } point ( ) x = 0; y= 0; } point operator+( point p1 ) { po
[单选题]有如下程序;include using namespace std;class Base{public;Base(inti){x=i;}void d有如下程序; #include <iostream> using namespace std; class Base { public; Base(inti){x=i;} void dispa0{cout<<x<<',';} private; int x; }; class Derived;public Base { public; Derive
[单选题]有如下程序:include using namespace std;class A {public: A() {cout<<"A";}};class有如下程序: #include <iostream> using namespace std; class A { public: A() {cout<<"A";} }; class B {public:B() {cout<<"B";}}; class C: public A { Bb; public: C() {cout<<"C";
[单选题]有如下程序:include using namespace std;class Stack {public: Stack(unsigned n= 1有如下程序: #include <iostream> using namespace std; class Stack { public: Stack(unsigned n= 10):size(n) {rep_=ew int[size]; top=0;} Stack(Stack& s):size(s.size) { rep_=new int[
[单选题]有如下程序:include using namespace std;Class x{protected: int a;public: x() {a=有如下程序: #include <iostream> using namespace std; Class x { protected: int a; public: x() { a=1; } }; class x1 : virtual public x { public: x1() { a+=1; cout<<A.1B.123C.242D.244
[单选题]有如下程序:include using namespace std;class AA{public: virtual void f() {cout<有如下程序: #include <iostream> using namespace std; class AA { public: virtual void f() { cout<< "AA"; } }; class BB : public AA { public: BB() { cout << "BB"; } }; claA.AAB.AA
[单选题]有如下程序include using namespace std;class base{public:virtual void f1(){cout<有如下程序#include <iostream>using namespace std;class base{public: virtual void f1() { cout<<"F1Base "; } virtual void f2() { cout<<"F2Base "; }};class derive: public base{ voi
[单选题]有如下程序:include using namespace std;class Base{private:charc;public:Base(cha有如下程序:#include <iostream>using namespace std;class Base{private: char c;public: Base(char n) :c(n){} ~Base() { cout<<c; } };class Derived: public Base{private: char c; public: