#!/perl
use strict;
use warnings;
my $max_month = 20 * 12;
my $curr_month = 0;
my $money = 58390;
my $saving = 0;
my $rate = 0.05 / 12;
while ($curr_month < $max_month) {
$curr_month++;
$saving = $saving * (1 + $rate);
$saving += $money;
}
print "$saving\n";
沒有留言:
張貼留言