✅ 정답 공개
class Shape:
def area(self):
return 0
class Circle(Shape):
def __init__(self, r):
self.r = r
def area(self):
return round(3.14 * self.r ** 2, 2)
class Rectangle(Shape):
def __init__(self, w, h):
self.w = w
self.h = h
def area(self):
return round(self.w * self.h, 2)
parts = input().split()
shape_type = parts[0]
if shape_type == 'circle':
s = Circle(float(parts[1]))
else:
s = Rectangle(float(parts[1]), float(parts[2]))
print(s.area())