正在加载图片...
class b public a public return getto void main Bb b setx(2) b sety (3) cout<<X=<<bgetxo<<tY=<<b gety(<<endl cout<<X+Y=<<b getsum(<<endlclass B:public A { public: int getsum() { return x + gety(); } }; void main() { B b; b.setx(2); b.sety(3); cout<<"X="<<b.getx()<<"\tY="<<b.gety()<<endl; cout<<"X + Y = "<<b.getsum()<<endl; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有