PI=3.14
class shape:
__x=0
__y=0
def get__x(self):
return shape.__x
def get__y(self):
return shape.__y
def put_x(self):
shape.__x=float(input("请输入x:"))
def put_y(self):
shape.__y=float(input("请输入y:"))
class Circle(shape):
r=1
def put_r(self):
Circle.r=float(input("请输入r:"))
def GetArea(self,R):
area=int(PI*R*R)
print(f"area={area}")
def GetDistance(self,X,Y):
distance=int((X*X+Y*Y)**0.5)
print(f"distance={distance}")
circle=Circle()
circle.put_x()
circle.put_y()
circle.put_r()
circle.GetArea(circle.r)
circle.GetDistance(circle.get__x(),circle.get__y())
