#define
P 3.1415
class Circle
{
public:
double m_r;
public:
Circle(double r = 0) : m_r(r){}
double GetSpace() const
{
return P*m_r*m_r;
}
double GetLength() const
{
return 2*P*m_r;
}
};
int main()
{
cout << "输入圆的个数:" << endl;
int n;
cin >> n;
Circle* p = new Circle[n];
for(int i = 0; i < n; i++)
{
cout << "输入第" << i+1 << "个圆的半径" << endl;
cin >> p[i].m_r;
cout << p[i].GetSpace() << endl;
cout << p[i].GetLength() << endl;
}
delete p;
return 0;
}