Created
January 11, 2017 11:57
-
-
Save xtetsuji/0087667d148eb3cdac712a1017df7aa3 to your computer and use it in GitHub Desktop.
When sum of all multiplation table numbers is subtracted 9, its answer is 2016.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $sum = 0; | |
for my $i (1..9) { | |
for my $j (1..9) { | |
$sum += $i * $j; | |
} | |
} | |
$sum -= 9; | |
print "sum = $sum\n"; | |
__END__ | |
$ perl 99sum.pl | |
sum = 2016 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment