题目:
思路:
公共除数之积 * 各自余数之积
提交:
let line
while ((line = readline())) {
let arr = line.trim().split(' ')
let a = Number(arr[0])
let b = Number(arr[1])
let t = 1
let length = a < b ? a + 1 : b + 1
for (let i = 2; i < length; i++) {
while (a % i === 0 && b % i === 0) {
t *= i
a = a / i
b = b / i
}
}
console.log(t * a * b)
}