<!DOCTYPE html><html leng = \'en\'><head><meta charset = \'UTF-8\'/></head><body><script>var num1 = parseInt(prompt(\'请输入相比较的两个数中较大一位\'));var num2 = parseInt(prompt(\'请输入相比较的两个数中较小一位\'));function test(num1, num2){var rem = num1 % num2;if(rem === 0){return num2;}num1 = num2;num2 = rem;return test(num1, num2);}var least = num1 * num2 / test(num1, num2);console.log(least + \'是这两个数的最小公倍数\');</script></body></html>
js写两个数的最小公倍数
未经允许不得转载:爱站程序员基地 » js写两个数的最小公倍数