eval.in

Paste #49618

OCaml — OCaml 4.00.1, pasted 3 years ago

1
2
3
4
5
6
let rec fib n =
  if n < 2 then n
  else (fib (n - 1)) + (fib (n - 2))

let _ =
  print_int (fib 30)

Program Output

832040

OK (0.088 sec real, 0.087 sec wall, 6 MB, 9 syscalls)

Fork