From 3c1167a081b9f880afd0579fe4717668e960ec5a Mon Sep 17 00:00:00 2001 From: asdiadenpotatisen <69951589+asdiadenpotatisen@users.noreply.github.com> Date: Thu, 22 Oct 2020 13:41:48 +0800 Subject: [PATCH] Update t01primeshcflcm_findab2.py --- t01primeshcflcm_findab2.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t01primeshcflcm_findab2.py b/t01primeshcflcm_findab2.py index 9d3fd14..835a615 100644 --- a/t01primeshcflcm_findab2.py +++ b/t01primeshcflcm_findab2.py @@ -1,2 +1,8 @@ # If a and b are integers such that a * b = 18, find the possible values of a + b. +num = 18 +a = 1 +for a in range(1, num): + b = num % a + if b == 0: + print("a: {}, b: {}, a+b: {}".format(a, b, a+b))