eval.in

Paste #177

Perl — Perl 5.16.1, pasted 4 years ago

1
2
3
sub fib{$_[0]<2?shift:fib($_[0]-1)+fib($_[0]-2)}

print fib 30;

Program Output

832040

OK (0.624 sec real, 0.624 sec wall, 8 MB, 81 syscalls)

Fork