Create a gist now

Instantly share code, notes, and snippets.

How many kind numbers 9*9 multiplation table has.
#!/usr/bin/perl
use strict;
use warnings;
my %seen;
for my $i (1..9) {
for my $j (1..9) {
$seen{$i * $j}++;
}
}
my @seen = keys %seen;
print "9*9 tables has " . @seen . " kind numbers\n";
__END__
$ perl 99seen.pl
9*9 tables has 36 kind numbers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment