Skip to content

Instantly share code, notes, and snippets.

@sasamijp
Last active January 3, 2016 13:09
Show Gist options
  • Save sasamijp/8467814 to your computer and use it in GitHub Desktop.
Save sasamijp/8467814 to your computer and use it in GitHub Desktop.
最大公約数
input=gets.split
r=input[0].to_i%input[1].to_i
until r==0 do
m=n
n=r
r=m%n
puts n
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment