class Circle
{
private:
double radius;
public:
static double PI;
Circle(double a=0);
Circle(Circle &c);
~Circle();
1
void setRadius(double a);
double getRadius();
double circumference();
double area();
friend double fCircle_L(Circle &r);
friend double fCircle_S(Circle &r);
};
double Circle::PI=3.1415;
Circle::Circle(double a):radius(a)
{
cout<<"Constructor run"<<endl;
}
Circle::Circle(Circle &c){
radius=c.radius;
cout<<"CopyConstructor run"<<endl;
}
Circle::~Circle()
{
cout<<"Destructor run"<<endl;
}
void Circle::setRadius(double a)
{
radius=a;
}
double Circle::getRadius(){
return radius;
}
double Circle::circumference(){
return (2PIradius);
}
double Circle::area()
{
return (PIradiusradius);
}
double fCircle_L(Circle &r)
{
r=r.radius;
}
double fCircle_S(Circle &r)
{
r=r.radius;
}好兄弟,最后该咋返回呢