Problem 3¶
Compute a greatest common divisor (GCD) between two positive integers x and y.
Please note:
If
xis greater-equalyandxis divisible byy, the GCD betweenxandyisy.Otherwise, the GCD between
xandyisGCD(y, x % y).
For x == 36 and y == 44, the GCD is 4.
Do not use math.gcd function.
Functions:
|
Compute the greatest common divisor (GCD) between |