日期:2014-05-16 浏览次数:20325 次
function GCD(a, b) {
if (a % b == 0) {return b; }
else if (a % b != 1) { GCD(b, a % b); }
else { return 1; }
}
alert(GCD(5,3));
function GCD(a, b) {
if (a % b == 0) {return b; }
else if (a % b != 1) {return GCD(b, a % b); } //else if (a % b != 1) { GCD(b, a % b); }
else { return 1; }
}
alert(GCD(5,3));