From ae14016c491659dcbb3ba837b6dcaa15a99f4dba Mon Sep 17 00:00:00 2001 From: MX <3037347690@qq.com> Date: Sun, 4 Oct 2026 14:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=AD=90=E7=B1=BB=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E9=87=8D=E5=86=99area=EF=BC=8C=E6=8C=89=E5=85=AC?= =?UTF-8?q?=E5=BC=8F=E8=AE=A1=E7=AE=97=E9=9D=A2=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 国庆考核.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/国庆考核.py b/国庆考核.py index d951dd5..47b4e17 100644 --- a/国庆考核.py +++ b/国庆考核.py @@ -1,3 +1,15 @@ class Shape: def area(self): return 0 + +class Circle(Shape): + def __init__(self, r): + self.r = r + def area(self): + return 3.14 * self.r * self.r + +class Square(Shape): + def __init__(self, side): + self.side = side + def area(self): + return self.side * self.side \ No newline at end of file