#!/usr/local/bin/perl $fib1 = 1; $fib2 = 2; $sum = 1; while ($fib2 < 4000000) { if($fib2 % 2 == 0){ $sum += $fib2; } $aux = $fib2; $fib2 += $fib1; $fib1 = $aux; } print $sum;
5+5
Post a Comment
1 comment:
5+5
Post a Comment