From c623fd1ff31b16fecd7e386c19c42bce39014b0d Mon Sep 17 00:00:00 2001 From: MX <3037347690@qq.com> Date: Sun, 4 Oct 2026 15:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86int=E6=94=B9=E4=B8=BAfloat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 国庆考核.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/国庆考核.py b/国庆考核.py index 391790d..35a0f7e 100644 --- a/国庆考核.py +++ b/国庆考核.py @@ -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())) \ No newline at end of file