题解 | #求最小公倍数#
求最小公倍数
https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
while True: try: n, m = map(int, input().split(' ')) if n > m: n, m = m, n #注意以m为步长切片,否则运算时长很大 for i in range(m, n*m+1, m): if i % n == 0 and i % m == 0: print(i) break except: break