def gcd(a, b) if b > a temp = a a = b b = temp end mod = a % b if mod == 0 return b else return gcd(b, mod) end end p gcd(210, 45) #15 p gcd(1, 1) #1
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more