#include
using namespace std;
class A{
protected:
int x;
int y;
public:
virtual void show() = 0;
};
class B:public A{
public:
void show(){
cout<
cin>>x>>y;
cout<
}
};
class C:public A{
public:
void show(){
cout<
cin>>x>>y;
cout<
}
};
class D:public A{
void show(){
cout<
cin>>x;
cout<
}
};
void main()
{
char i=’0′;
A *p;
cout<
while(i!=’4′)
{
cout<
cin>>i;
switch(i){
case ’1′:p = new B;p->show();break;
case ’2′:p = new C;p->show();break;
case ’3′:p = new D;p->show();break;
}
}
}