{
CShape *pshape;
CCircle circle(2.0);
float a;
cout<<"请输入圆的半径:";
cin>>a;
circle.setcircle(a);
pshape=&circle;
pshape->draw();
cout<<"圆的面积为;"<<pshape->area()<<setw(10)<<"圆的周长为;"<<pshape->zc()<<endl;
}
elseif(i==4)
{
CShape *pshape;
CCylinder yz(2.0,3.0);
float a,b;
cout<<"请输入圆柱的底面半径和高:";
cin>>a>>b;
yz.setcylinder(a,b);
pshape=&yz;
pshape->draw();
cout<<"圆柱的面积为:"<<pshape->area()<<setw(10)<<"圆柱的体积为:"<<pshape->valum()<<endl;
}
elseif(i==5)
{
CShape *pshape;
CCone cone(5.0,4.0);
float a,b;
cout<<"请输入母线长和底面半径:";
cin>>a>>b;
cone.setcone(a,b);
pshape=&cone;
pshape->draw();
cout<<"圆锥的体积为:"<<pshape->valum()<<endl;
}
elseif(i==6)
{
CShape *pshape;
CRectangle rectangle(3.0,2.0);
float a,b;
cout<<"请输入长方形的长和宽:";
cin>>a>>b;
rectangle.setrectangle(a,b);
pshape=&rectangle;
pshape->draw();
cout<<"长方形的面积为:"<<pshape->area()<<setw(10)<<"长方形的周长为:"<<pshape->zc()<<endl;
}
elseif(i==7)
{
CShape *pshape;
CPolygon polygon(2.0,4);
float a;
int b;
cout<<"请输入多边形的边长和边数:";
cin>>a>>b;
polygon.setpolygon(a,b);
pshape=&polygon;
pshape->draw();
cout<<"多边形的面积为:"<<pshape->area()<<setw(10)<<"周长为:"<<pshape->zc()<<endl;
}
elseif(i==8)
{
CShape *pshape;
CTriangle triangle(3.0,4.0,5.0);
float a,b,c;
cout<<"请输入三角形三边长:";
cin>>a>>b>>c;
triangle.settriangle(a,b,c);
pshape=▵
pshape->draw();
cout<<"三角形的周长为:"<<pshape->zc()<<"面积为:"<<pshape->area()<<endl;
}
elseif(i==9)
{
return;
}
else
{
cout<<"输入错误,请重新输入!";
}
cout<<"是否继续其他操作(Y/N)?"<<endl;
cin>>d;
}
}