题解 | #求最小公倍数#
求最小公倍数
https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void (async function () { while ((line = await readline())) { const [a, b] = line.split(" "); // 计算两个数的最大公约数 function gcd(a, b) { if (b === 0) { return a; } else { return gcd(b, a % b); } } // 计算两个数的最小公倍数 function lcm(a, b) { return (a * b) / gcd(a, b); } console.log(lcm(a, b)); } })();