eval.in

Paste #1472

Slash — Slash HEAD, pasted 4 years ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<%

def fib(n) {
  if n < 2 {
    n;
  } else {
    fib(n - 1) + fib(n - 2);
  }
}

print(fib(30));

Program Output

832040

OK (0.664 sec real, 0.667 sec wall, 5 MB, 10 syscalls)

Fork