裴波那契数列ruby实现

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

def fib n 
	i = 2
	a ,b = 1, 1
	while i < n
		a,b = b, a+b
		i += 1
	end
	b
end
p fib 16
#打印987