Sha256: 9905011e0ac22bcc88263c895f041d637b42f39561798da30a7e0dfb0900bddb
Contents?: true
Size: 184 Bytes
Versions: 26
Compression:
Stored size: 184 Bytes
Contents
# Greatest common divisor of a and b def gcd a, b x = [a,b].max y = [a,b].min while y != 0 r = x % y x = y y = r end x end puts gcd ARGV[0].to_i, ARGV[1].to_i
Version data entries
26 entries across 26 versions & 2 rubygems