将下列程序补充完整:
#include
usingnamespacestd;
classbase
{
Private:intx;
Public:base(inta){x=a;}
intget(){returnx;}
voidshowbase(){cout<<"x="<
};
classDerived:publicbase
{private:inty;
Public:Derived(inta,intb):base(a){y=b;}
voidshowderived()
{cout<<"x="<
};
voidmain()
{
baseb(3);
Derivedd(6,7);
b.showbase();
d.showderived();
__________________;
b.showbase();
__________________;
b1.showbase();
base*pb=&b1;
pb->showbase();
d.showderived();
b.showbase();
}
输出结果如下:
x=3
x=6,y=7
x=6
x=6
x=6
x=6,y=7
x=6