#include<stdio.h>
class CCircle
{
public:
CCircle(int r);//构造函数
void DisplayArea();
~CCircle();
private:
int m_Radius;
};
CCircle::CCircle(int r)
{
m_Radius = r;
}
CCircle::~CCircle()
{
}
void CCircle:: DisplayArea()
{
double s = 0;
s = 3.14 * m_Radius * m_Radius;
printf("面积是:%2f\n", s);
}
int main()
{
CCircle MyCircle(10);
MyCircle.DisplayArea();
return 0;
}