题解 | #小乐乐与欧几里得#
小乐乐与欧几里得
http://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
n, m = map(int, input().split())
p = n * m
tmp=n % m
while tmp != 0:
n = m
m = tmp
tmp = n % m
max = m
min = p//max
print(max+min)
小乐乐与欧几里得
http://www.nowcoder.com/practice/da13e0cf321e4df9acd0fdf0a433cbb0
n, m = map(int, input().split())
p = n * m
tmp=n % m
while tmp != 0:
n = m
m = tmp
tmp = n % m
max = m
min = p//max
print(max+min)
相关推荐