|
class Circle:
def __init__(self, x=0, y=0, radius=1):
self.__x = x
self.__y = y
self.__radius = radius
def calDiameter(self):
return 2 * self.__radius
def calArea(self):
return 3.14 * self.__radius ** 2
def calPerimeter(self):
return 2 * 3.14 * self.__radius
def output(self):
print(f"Center=({self.__x},{self.__y}) and Radius={self.__radius}")
print(f"Diameter={self.calDiameter()}")
print(f"Area={self.calArea():.1f}")
print(f"Perimeter={self.calPerimeter():.1f}")
x, y, radius = map(int, input().split())
circle = Circle(x, y, radius)
circle.output()
|
|