2006-02-28 フィボナッチ数列 フィボナッチ数列。だんだん遅くなります。あとでMemoiseを試します。 def fib(n) if n <= 1 1 else fib(n-1) + fib(n-2) end end (0..20).each do |n| puts fib(n) end