From a20904ef985df1da89651b5a17ded965fef94869 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@pinebookpro" Date: Tue, 18 Jan 2022 11:24:40 +0100 Subject: [PATCH] Make a the bigger of the ints --- algebre-non-lineaire/euclide.py | 3 +++ algebre-non-lineaire/euclide_etendu.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/algebre-non-lineaire/euclide.py b/algebre-non-lineaire/euclide.py index 0787566..0848be6 100755 --- a/algebre-non-lineaire/euclide.py +++ b/algebre-non-lineaire/euclide.py @@ -16,6 +16,9 @@ def main(): a = int(input("a : ")) b = int(input("b : ")) + if b > a: + a, b = b, a + # Initialisation r = ["r", a % b] a = ["a", a] diff --git a/algebre-non-lineaire/euclide_etendu.py b/algebre-non-lineaire/euclide_etendu.py index d8e316d..ed95390 100755 --- a/algebre-non-lineaire/euclide_etendu.py +++ b/algebre-non-lineaire/euclide_etendu.py @@ -16,6 +16,9 @@ def main(): a = int(input("a : ")) b = int(input("b : ")) + if b > a: + a, b = b, a + # Initialisation r = ["r", a, b] u = ["u", 1, 0]