#include<iostream>
#include<iomanip>
using namespace std;
class Point
{
public:
double X, Y;
Point(double x, double y);
double GetX();
double GetY();
double SetPoint(double x0, double y0);
void Show();
};
Point::Point(double x=0, double y=0) :X(x), Y(y)
{
}
double Point::GetX()
{
return X;
}
double Point::GetY()
{
return Y;
}
double Point::SetPoint(double x0, double y0)
{
X = x0;
Y = y0;
}
void Point::Show()
{
cout << X << " " << Y << endl;
}
class Circle :public Point
{
public:
double m_X,m_Y,R;
double Girth();
double Area();
void Show();
Circle(double m_x, double m_y, double r);
};
Circle:: Circle(double m_x, double m_y, double r)
{
m_X = m_x;
m_Y = m_y;
R = r;
}
double Circle::Girth()
{
return 2 * 3.14 * R;
}
double Circle::Area()
{
return 3.14 * R * R;
}
void Circle::Show()
{
cout << "(" << m_X << "," << m_Y << ")" << endl;
cout << R;
}
class Cylinder :public Circle
{
public:
Cylinder();
double H, Feature;
double SetCylinder(Circle(double m_x, double m_y, double r), double h);
double Area();
double Volumn();
void Show();
};
double Cylinder::SetCylinder(Circle(double m_x, double m_y, double r),double h)
{
H = h;
}
double Cylinder::Area()
{
return 2 * 2 * Circle::R * Circle::R + 2 * 3.14 * Circle::R * H;
}
double Cylinder::Volumn()
{
return 3.14 * Circle::R * Circle::R * H;
}
void Cylinder::Show()
{
cout << "(" << m_X << "," << m_Y << ")" << endl;
cout << R << endl;
cout << H << endl;
}
int main()
{
double x, y;
cin >> x >> y;//若输入:10 20
Point p1(x, y);
p1.SetPoint(x + 10, y + 5);
cout << fixed << setprecision(1);
p1.Show();//单独占一行输出:10,20
Circle c1(p1.GetX(), p1.GetY(), 20);
c1.Show();//输出两行:圆心一行,半径一行
cout << "c1的周长是:" << c1.Girth() << endl;//一个数据一行
cout << "c1的面积是:" << c1.Area() << endl;//一个数据一行
Cylinder cy1;
cy1.SetCylinder(c1, 10.5);
cy1.Show();//输出三行:圆心一行,半径一行,高一行
cout << "cy1的表面积是:" << cy1.Area() << endl;//一个数据一行
cout << "cy1的体积是:" << cy1.Volumn() << endl;//一个数据一行
return 0;
}