{"author_name":"argius","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","height":"190","version":"1.0","type":"rich","width":"100%","categories":["Ruby"],"url":"https://argius.hatenablog.jp/entry/20060508/1147107003","title":"\u7df4\u7fd2\uff1a\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u306e\u4e92\u9664\u6cd5","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fargius.hatenablog.jp%2Fentry%2F20060508%2F1147107003\" title=\"\u7df4\u7fd2\uff1a\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u306e\u4e92\u9664\u6cd5 - argius note\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/argius/","blog_url":"https://argius.hatenablog.jp/","blog_title":"argius note","published":"2006-05-08 01:50:03","image_url":null,"description":"\u6700\u5927\u516c\u7d04\u6570\u3092\u6c42\u3081\u308b\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3002 def gcd x, y if y == 0 then x else gcd y, x % y end end def gcd2 x, y while y != 0 x, y = y, x % y end return x end puts gcd(50, 125) #=> 25 puts gcd2(50, 125) #=> 25 puts gcd(980, 1421) #=> 49 puts gcd2(980, 1421) #=> 49\u3061\u3068\u3084\u3063\u3064\u3051\u3067\u306f\u3042\u308b\u3002\u3042\u3068\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u306f\u3069\u3046\u306b\u304b\u306a\u3089\u306a\u3044\u3082\u306e\u304b\u3002"}