展开全部
#define MATH_PI 3.1415926
class Circle
{
public:
Circle():cx(0), cy(0),r(0){};
Circle(double x_in, double y_in, double r_in):cx(x_in), cy(y_in),r(r_in){};
public:
double centerX()const {return cx;};
double centerY()const {return cy;};
double setCenterX(double x_in){cx = x_in;};
double setCenterY(double x_in){cy = y_in;};
double getPerimeter()const{return 2*MATH_PI*r;};
private:
double cx;
double cy;
double r;
}
class Circle
{
public:
Circle():cx(0), cy(0),r(0){};
Circle(double x_in, double y_in, double r_in):cx(x_in), cy(y_in),r(r_in){};
public:
double centerX()const {return cx;};
double centerY()const {return cy;};
double setCenterX(double x_in){cx = x_in;};
double setCenterY(double x_in){cy = y_in;};
double getPerimeter()const{return 2*MATH_PI*r;};
private:
double cx;
double cy;
double r;
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询