分享至
朋友圈
微信
qq空间
qq
微博
复制
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