eval.in

Paste #163

Ruby — MRI 1.9.3, pasted 4 years ago

1
2
3
4
5
6
7
8
9
def fib(n)
  if n < 2
    n
  else
    fib(n - 1) + fib(n - 2)
  end
end

puts fib 30

Program Output

832040

OK (0.224 sec real, 0.227 sec wall, 7 MB, 22 syscalls)

Fork