From 56918e65d7a95a45e7fba33f4b3832cdf33f3943 Mon Sep 17 00:00:00 2001 From: Sidney Zhang Date: Mon, 15 Dec 2025 17:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(solutions/0009)=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AC=A7=E6=8B=89=E9=A1=B9=E7=9B=AE=E7=AC=AC?= =?UTF-8?q?9=E9=A2=98=E7=9A=84=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solutions/0009/eular_9.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 solutions/0009/eular_9.py diff --git a/solutions/0009/eular_9.py b/solutions/0009/eular_9.py new file mode 100644 index 0000000..3edb7e2 --- /dev/null +++ b/solutions/0009/eular_9.py @@ -0,0 +1,18 @@ +""" +a^2 + b^2 = c^2 +a + b + c = 1000 +FIND a*b*c +""" + + +def euler_9(): + for a in range(1, 1000): + for b in range(a, 1000): + c = 1000 - a - b + if a**2 + b**2 == c**2: + print(f"Found a={a}, b={b}, c={c}") + return a * b * c + + +if __name__ == "__main__": + print(euler_9())