CodePudding user response:
Problem of c + + code, heavily reward!CodePudding user response:
#include# define PI 3.14
using namespace std;
The class Circle
{
Public:
Circle radius, (int) {radius=radius; }
Circle, Circle & amp; C);
~ Circle () {}
Int GetRadius () {return Radius; }
Const int GetArea ();
Private:
Int the Radius;
};
Circle: : Circle (Circle & amp; C) {
C.R adius=Radius;
}
Const int Circle: : GetArea () {
Radius, return PI * * Radius;
}
Int main ()
{
int r;
Circle the demo (3);
cout <"Is the area of the" demo (3) & lt;
cout <"Please enter a circle of radius r=";
cin> r;
Circle not (r);
cout <"Not (r) is the area of the" & lt;
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Copyright statement: this article to CSDN blogger (ptspzy) of the original articles, follow BY CC 4.0 - SA the copyright agreement, reproduced and this statement, please attach the original source link
The original link: https://blog.csdn.net/ptspzy/article/details/46497457