//
// Created by 刘彪 on 2020/3/2.
//继承与派生 测试 圆类
#include <iostream>
#include <cmath>
using namespace std;
class Point{
protected:
int x,y;
public:
Point(){}
};
class Circle:public Point{
protected:
double r,area;
public:
Circle(int a,int b){
x = a;
y = b;//自己:继承而来
r = sqrt(x*x +y*y);
area = 3.1415926 * r*r;
}
void dispPoint(){
cout<<"所经过点的坐标:("<<x<<","<<y<<")"<<endl;
}
void dispRadius(){
cout<<"圆的半径"<<r<<endl;
}
void dispArea(){
cout<<"圆的面积:"<<area<<endl;
}
};
int main(){
Circle c(10,25);
c.dispPoint();
c.dispRadius();
c.dispArea();
return 0;
}