题解 | #求最小公倍数#
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
简单但超时...
a, b = map (int, input().split())
res = []
for n in range(1, a*b+1):
if n%a==0 and n%b==0:
res.append(n)
print(min(res))
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
简单但超时...
a, b = map (int, input().split())
res = []
for n in range(1, a*b+1):
if n%a==0 and n%b==0:
res.append(n)
print(min(res))
相关推荐