eval.in

Paste #183

Perl — Perl 5.16.1, pasted 4 years ago

1
2
3
4
5
6
7
sub fib {
  my ($a, $b) = (0, 1);
  ($a, $b) = ($b + $a, $a) for 1..shift;
  $a;
}

print fib 30;

Program Output

832040

OK (0.004 sec real, 0.002 sec wall, 8 MB, 81 syscalls)

Fork