#include
#include
using namespace std;
#define PI 3.1415
class circle
{
public:
void information(double & a)
{
cout<<"请输入半径:";
cin>>a;
}
};
class sphere:public circle
{
public:
void first(double a)
{
double v1;
double s1;
s1=4*PI*a*a;
//第一二处错误
v1=(PI*a*a*a*4)/3 ;
cout<<"球的表面积为:"< }
};
class cylinder:public circle
{
public:
void second(double a)
{
double s2;
double v2;
double h;
cout<<"请输入圆柱的高:";
cin>>h;
s2=2*2*PI*a*a+2*PI*a*h;
v2=2*PI*a*a*h;
cout<<"圆柱的表面积为:"< }
};
class cone:public circle
{
public:
void third(double a)
{
double s2;
double v2;
double l;
cout<<"请输入圆锥的高:";
cin>>l;
s2=2*PI*a*a+PI*a*l;
v2=2*PI*a*a*l/3;
cout<<"圆锥的表面积为:"< }
};
void main()
{
int chose;
double a;
double h;
double l;
cin>>chose;
circle bason;
bason.information(a);
cout<<"请选择:"< if(chose==1)
{
sphere bason;
//第三处错误
bason.first(a);
}
else if(chose==2)
{
cylinder bason;
bason.second(a);
}
else if(chose==3)
{
cone bason;
bason.third(a);
}
}