#include
#include
using namespace std;
////////////////////////////////////////////////////////////////////
class pmjh {
public:
virtual template void mj() {return;}
};
class sj : public pmjh {
public:
virtual void mj(){A a;B b;cout<<"请输入底:";cin>>a;cout<>b;cout<};
class ch : public pmjh {
public:
virtual void mj(){A a;B b;cout<<"请输入长:";cin>>a;cout<>b;cout<};
class zh : public pmjh {
public:
virtual void mj(){A a;cout<<"请输入边长:";cin>>a;cout<};
class px : public pmjh {
public:
virtual void mj(){A a;B b;cout<<"请输入底:";cin>>a;cout<>b;cout<};
class yu : public pmjh{
public:
virtual void mj(){A a;cout<<"请输入半径:";cin>>a;cout<};
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
int main() {
int a=0;
pmjh *p;
sj s;
ch c;
zh z;
px x;
yu y;
for(;;){
cout<<"面积计算"< cin>>a;
switch (a){
case 1:p=&s;
case 2:p=&c;
case 3:p=&z;
case 4:p=&x;
case 5:p=&y;
case 0:return 0;
default:cout<<"输入错误!!!";
return 1;
}
p->mj();
cout<<"按任意键继续";
while(!kbhit());
}
return 0;
}
--------------------next---------------------
阅读(1775) | 评论(0) | 转发(0) |