From 21a584b9115f305eed63bc19141be9b2ddca76a0 Mon Sep 17 00:00:00 2001 From: ZiLi-meowzz <52988141+ZiLi-meowzz@users.noreply.github.com> Date: Sun, 25 Oct 2020 11:19:05 +0800 Subject: [PATCH] Update t01primeshcflcm_hcf1.py --- t01primeshcflcm_hcf1.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t01primeshcflcm_hcf1.py b/t01primeshcflcm_hcf1.py index 7ea02a8..1f4c50d 100644 --- a/t01primeshcflcm_hcf1.py +++ b/t01primeshcflcm_hcf1.py @@ -1,2 +1,7 @@ # Find the Highest Common Factor (HCF) of 18 and 30. +a = 18 +b = 30 +while b != 0: + (a, b) = (b, a % b) +print(a)