def gcd(a,b)
	while b > 0
		r = a%b
		a = b
		b = r
	end
	return a
end

def lcd(a,b)
	return a*b/gcd(a,b)
end

print gcd(15750,27216)	#=>126
print lcd(66,33)		#=>66

 

分享到: