ユークリッドの互除法
code:euclid.js
a, b = 143, 187
while(true){
if(a == b){
alert(a)
break
}
a > b ? a -= b : b -= a
}