题解 | #Redraiment的走法#
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
先求最大公约数,再求最大公倍数 公倍数 (x*y)/最大公约数
let line
function get_base_min(x,y){
if(y == 0 ){
return x
}
let z = x % y;
return get_base_min(y,z)
}
function get_base_max(x,y){
return (x * y) / get_base_min(x,y)
}
while(line = readline()){
let arr = line.split(' ').map(i=>parseInt(i))
let res = get_base_max(arr[0],arr[1]);
console.log(res);
arr = []
}