#include <iostream>
#include <cstring> using namespace std; class Point
{
private:
int x,y;
public:
Point(int,int);
void SetPoint(int,int);
int GetX(){return x;}
int GetY(){return y;}
void Print();
}; class Circle:public Point
{
private:
double radius;
public:
Circle(int,int,double);
void SetRadius(double);
double GetRadius();
double Area();
void Print();
}; void Point::SetPoint(int a, int b)
{
x=a;
y=b;
} Point::Point(int a, int b)
{
SetPoint(a,b);
} void Point::Print()
{
cout<<"["<<GetX()<<','<<GetY()<<"]"<<endl;
return;
} Circle::Circle(int a, int b, double r):Point(a,b)
{
radius=r;
} void Circle::SetRadius(double r)
{
radius=r;
return;
} double Circle::GetRadius()
{
return radius;
} double Circle::Area()
{
return 3.14*radius*radius;
} void Circle::Print()
{
cout<<"Circle c Center=";
Point::Print();
cout<<"Radius="<<radius<<endl;
cout<<"The centre of circle c ";
Point::Print();
cout<<"The area of circle c "<<Area()<<endl;
return;
} int main()
{
int x,y;
int a,b,r;
cin>>x>>y>>a>>b>>r;
Point one(x,y);
cout<<"Point p ";
one.Print();
Circle two(a,b,r);
two.Print();
return ;
}
05-28 18:44