主观

给出下面程序输出结果。

#include

class Base

{private:

int Y;

public:

Base(int y=0){Y=y;cout<<"Base("<

~Base(){cout<<"~Base()\n";}

void print(){cout<

};

class Derived:public Base

{private:

 int Z;

 public:

 Derived(int y,int z):base(y)

{Z=z;

cout<<"Derived("<

}

 ~Derived(){cout<<"~Derived()\n";

 void print()

{base::print()

cout<

};

void main()

{Derive d(10,20);

d.print();

}

参考答案
您可能感兴趣的试题
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服