怎样将fun(a)fun(b)fun(c)的值加在一起#includeusing namespace std;class Circle{public:Circle(){}virtual double const Area(){return 0.0;}protected:float zhijing;};class DBarea:public Circle//顶部面积{public:DBarea(float D){zhiji
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 15:03:26
怎样将fun(a)fun(b)fun(c)的值加在一起#includeusing namespace std;class Circle{public:Circle(){}virtual double const Area(){return 0.0;}protected:float zhijing;};class DBarea:public Circle//顶部面积{public:DBarea(float D){zhiji
怎样将fun(a)fun(b)fun(c)的值加在一起
#include
using namespace std;
class Circle
{
public:
Circle(){}
virtual double const Area(){return 0.0;}
protected:
float zhijing;
};
class DBarea:public Circle//顶部面积
{
public:
DBarea(float D){zhijing=D;}
virtual double const Area(){return 3.14*0.5*0.5*zhijing*zhijing;}
protected:
float zhijing;
};
class YYarea:public Circle//阴影面积
{
public:
YYarea(float d,float H,float L){ypzhijing=d,gao=H,shengzi=L;}
virtual double const Area(){return (3.14*0.5*0.5*ypzhijing*ypzhijing*gao*gao)/(gao-shengzi)/(gao-shengzi);}
protected:
float ypzhijing,gao,shengzi;
};
class CMarea:public Circle//圆柱的侧面面积
{
public:
CMarea(float D,float H){zhijing=D,gao=H;}
virtual double const Area(){return 3.14*zhijing*gao;}
protected:
float zhijing,gao;
};
int fun(Circle & sp)
{
cout
怎样将fun(a)fun(b)fun(c)的值加在一起#includeusing namespace std;class Circle{public:Circle(){}virtual double const Area(){return 0.0;}protected:float zhijing;};class DBarea:public Circle//顶部面积{public:DBarea(float D){zhiji
把下面几行改一下就可以了
int fun(Circle & sp)
{
cout