BC44 小乐乐与欧几里得
思路:
step1:输入两个数;并复制这两个数;
step2:使用辗转相除法求最大公约数;
step3:两数相乘除以最大公约数就是最小公倍数;
step4:打印即可;
代码如下:
m,n = list(map(int,input().split()))
x = m
y = n
r = m % n
while r != 0:
m = n
n = r
r = m % n
e = x*y//n
print(e+n)
m,n = list(map(int,input().split()))
x = m
y = n
r = m % n
while r != 0:
m = n
n = r
r = m % n
e = x*y//n
print(e+n)