eval.in

Paste #166

Lua — Lua 5.2.1, pasted 4 years ago

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

print(fib(30))

Program Output

832040

OK (0.216 sec real, 0.217 sec wall, 3 MB, 13 syscalls)

Fork