eval.in

Paste #181

Lua — Lua 5.2.1, pasted 4 years ago

1
2
3
4
5
6
7
8
9
function fib(n)
  local a, b = 0, 1
  for i = 1, n do
    a, b = b + a, a
  end
  return a
end

print(fib(30))

Program Output

832040

OK (0.004 sec real, 0.001 sec wall, 3 MB, 13 syscalls)

Fork