最大公約数問題

function gdc(a, b) {
  return (b == 0) ?
    a :
    gdc(b, (a % b));
}

print(gdc(10, 4));
print(gdc(35, 21));
print(gdc(150, 36));