aboutsummaryrefslogtreecommitdiff
path: root/challenge-051/javier-luque/raku/ch-2.p6
blob: 82768bfb7ae6817c12f7f493fb4213b2fb926a8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Test: perl6 ch-2.p6
use v6.d;

sub MAIN() {
    my @solutions;

    for (2 ... 9) -> $h {
        for (2 .. 9) -> $t {
            for (2 .. 9) -> $o {
                if ( $h * $t != $t * $o &&
                     $h * $t != $h * $t * $o &&
                     $h * $o != $h * $t * $o &&
                     $t * $o != $h * $t * $o ) {
                    push @solutions, "$h$t$o";
                }
            }
        }
    }

    say @solutions.join(" ");
}