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))