题解 | #求最小公倍数#

求最小公倍数

https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3

n1, n2 = list(map(int, input().strip().split()))

max_n = max(n1, n2)

i = 1

while True:
    tmp = max_n * i
    if tmp % n1 == 0 and tmp % n2 == 0:
        print(tmp)
        break
    i += 1

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务