}
clsaa Derived:public Base{
int c,d;
public:
Derived(int x,int y,int z,int m):Base(x,y){c=z;d=m;}
Void show(){cout<};
int main()
{
Base B1(50,50),*pb;
Derived DI(10,20,30,40);
Pb=&D1;
Pb->show();
Return 0;
}
运行时输出的结果是
A)10,20 B)30,40 C)20,30 D)50,50
(31)有如下程序:
#include
using namespace std;
class A
{
public;
A(int i){x=i;}
Void sispa(){cout<Private:
int x;
};
class B;publicA
{
public;
B(int i):A(i+10){x=i;}
voud dispb(){dispa();cout<Private:
Int x;
};
int main()