All pastes #296032 Raw Edit

Mine

public text v1 · immutable
#296032 ·published 2006-12-29 22:19 UTC
rendered paste body
use strict;
use warnings;

for (my $n = 0; $n <= 9; $n++) {
  for (my $r = 0; $r <= 9; $r++) {
    print "$r\n";
    for (my $s = 0; $s <= 9; $s++) {
      for (my $a = 0; $a <= 9; $b++) {
        for (my $b = 0; $b <= 9; $b++) {
          for (my $h = 0; $h <= 9; $h++) {
            for (my $f = 0; $f <= 9; $f++) {
              for (my $k = 0; $k <= 9; $k++) {
                next unless (($n*10+$h) > 0 && ($n*10+$s) > 0);
                if (($n == (($a*10+$b) * ($f*10+$b)) - (($n * $f))) &&
                   ($r == (($n*10+$h) * ($r*10+$h)) - ($n*10+$s)) &&
                   ($s == (($a*10+$b) * ($n*10+$s)) - (($a*10+$b) + ($f*10+$b))) &&
                   ($a == ($a*10+$b) - ($n*10+$s)) &&
                   ($b == (($r*10+$h) + ($n*10+$s)) / ($n*10+$h)) &&
                   ($h == (($n*10+$s) * ($r*10+$h)) - (($n*10+$f) * ($n*10+$h))) &&
                   ($f == (($n*10+$f) + ($n*10+$h)) / ($n*10+$s)) &&
                   ($k == ($n*10+$h) - ($f*10+$b))) {
                     print "$n $r $s $a $b $h $f $k\n";
                }
              }
            }
          }
        }
      }
    }
  }
}