my $N = ; my $ans = 0; for (my $i = 1; $i <= $N; $i++) { $ans = $ans + $i; } print $ans;