有如下程序,运行时的输出结果是。 #include

有如下程序,运行时的输出结果是()。

 #include<iostream> using namespace std; class B{ 
public: B(int xx):x(xx){++count;x+=10;} 
virtual void show() const {cout<<count<<'_'<<x<<endl;}
 protected: static int count; private: int x; }; class D:
public B{ public: D(int xx,int yy):B(xx),y(yy){++count;y+=100;} 
virtual void show() const {cout<<count<<'_'<<y<<endl;} 
private: int y; }; 
int B::count=0; int main(){ B *ptr=new D(10,20); ptr->show(); delete ptr; return 0; }
答案
B

题目信息

题号:6247
题型:单选题
难度:普通