#!/usr/bin/perl
#
# Run this with
# $ perl fib.pl
#

sub h {
  my ($n) = @_;
  my ($a, $b, $c);
  $a = 0;
  $b = 1;
  for (my $i=2; $i<=$n; $i++){
    $c = $a + $b;
    $a = $b;
    $b = $c;
  }
  return($b);
}

for my $i (1..10){
  print $i, " ", h($i), "\n";
}
