DEFDBL A-Z
FOR cr = 465 TO 999
tst$ = LTRIM$(STR$(cr * cr * cr))
good = 1
FOR i = 1 TO 8
IF i <> 2 THEN
IF INSTR(MID$(tst$, i + 1), MID$(tst$, i, 1)) THEN good = 0: EXIT FOR
ELSE
IF INSTR(MID$(tst$, i + 1), MID$(tst$, i, 1)) <> 3 THEN good = 0: EXIT FOR
END IF
NEXT
IF good THEN
cube$ = LTRIM$(STR$(cr * cr * cr))
root$ = LTRIM$(STR$(cr))
FOR i = 1 TO 3
ix = INSTR(cube$, MID$(root$, i, 1))
PRINT MID$("INVENTORY", ix, 1);
NEXT
PRINT
PRINT cr * cr * cr, cr
END IF
NEXT
The first line of the output is:
RYE
That's your stock.
Actual numbers left out so as not to be a spoiler for the alphametic.
|
Posted by Charlie
on 2011-03-19 14:04:18 |