1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/usr/local/bin/perl
use strict;
use warnings;
use B::Deparse;

sub komanechi {
    for my $i ( 1 .. 5**8 ) {
        my $formula = 1;
        for my $n ( 2 .. 9 ) {
            $formula .= ( '', qw{+ - * /} )[ $i % 5 ] . $n;
            $i /= 5;
        }
        next if  100 != eval $formula;
        print "$formula\n";
    }
}

komanechi;