Compare commits

..

2 Commits

Author SHA1 Message Date
MX cd181ec54b 代码思路 2026-10-04 15:31:50 +08:00
MX c623fd1ff3 将int改为float 2026-10-04 15:01:40 +08:00
+2 -2
View File
@@ -14,8 +14,8 @@ class Square(Shape):
def area(self):
return self.side * self.side
r = int(input("请输入圆的半径: "))
side = int(input("请输入正方形的边长: "))
r = float(input("请输入圆的半径: "))
side = float(input("请输入正方形的边长: "))
shapes = [Circle(r), Square(side)]
for i in shapes:
print(i.__class__.__name__ + "的面积为: " + str(i.area()))