diff --git a/国庆考核.py b/国庆考核.py index 328be32..391790d 100644 --- a/国庆考核.py +++ b/国庆考核.py @@ -17,3 +17,5 @@ class Square(Shape): r = int(input("请输入圆的半径: ")) side = int(input("请输入正方形的边长: ")) shapes = [Circle(r), Square(side)] +for i in shapes: + print(i.__class__.__name__ + "的面积为: " + str(i.area())) \ No newline at end of file