有如下程序:
#include
using name space std;
classB
public:
B(int xx):x(xx)++count;x+=10;
virtual void show()const
cout<<count<<’_’<<x<<endl;
protected:
static int count;
private:
intx;
;
class D:publicB
public:
D(int xx,int yy):B(xx),y(yy)++count;y+=100;
virtual void show()const
cout<<count<<’_’<<y<endl;
pnvate:
inty;
;
int B::count=0;
intmain()
B*ptr=new D(10,20);
ptr->show();
delete ptr;
return 0;
运行时的输出结果是()。
A.1_120
B.2_120
C.1_20
D.2_20