Replace each of the letters by a different number from 0 to 9 to satisfy the following alphanumeric equation:
(PIN)*(PIN) = BUNDLE
Note: Neither P nor B can be 0.
324 * 324 = 104976
487 * 487 = 237169
DEFDBL A-Z
CLS
FOR p = 1 TO 9
used(p) = 1
FOR b = 1 TO 9
IF used(b) = 0 THEN
used(b) = 1
FOR i = 0 TO 9
IF used(i) = 0 THEN
used(i) = 1
FOR n = 0 TO 9
IF used(n) = 0 THEN
used(n) = 1
FOR u = 0 TO 9
IF used(u) = 0 THEN
used(u) = 1
FOR d = 0 TO 9
IF used(d) = 0 THEN
used(d) = 1
FOR l = 0 TO 9
IF used(l) = 0 THEN
used(l) = 1
FOR e = 0 TO 9
IF used(e) = 0 THEN
used(e) = 1
pin = p * 100 + i * 10 + n
bundle = b * 100000 + u * 10000 + n * 1000 + d * 100 + l * 10 + e
IF pin * pin = bundle THEN
PRINT pin; "*"; pin; "="; bundle
END IF
used(e) = 0
END IF
NEXT
used(l) = 0
END IF
NEXT
used(d) = 0
END IF
NEXT
used(u) = 0
END IF
NEXT
used(n) = 0
END IF
NEXT
used(i) = 0
END IF
NEXT
used(b) = 0
END IF
NEXT
used(p) = 0
NEXT
|
Posted by Charlie
on 2007-06-09 15:53:46 |