有如下程序: #include<iostream> usingnamespacestd; classB{ public: B(intxx):x(xx){++count;x+=10;} virtualvoidshow( )const {cout<<count<<<<x<<endl;} protected: staticintcount; private: intx; }; classD:publicB{ public: D(intxx,intyy):B(XX),y(yy){++count;y+= 100;) virtualvoidshow( )const {cout<<count<<<<y<<endl); private: inty; }; intB::count==0; intmain( ){ B*ptr=newD(10,20); ptr->show( ); deleteptr; return0; } 运行时的输出结果是( )。
免费的网站请分享给朋友吧