RosettaCodeData/Task/Narcissistic-decimal-number/Craft-Basic/narcissistic-decimal-number.basic
2023-07-01 13:44:08 -04:00

52 lines
424 B
Text

dim p[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
let l = 10
let n = 25
do
if c < n then
if x >= l then
for i = 0 to 9
let p[i] = p[i] * i
next i
let l = l * 10
endif
let s = 0
let y = x
do
if y > 0 then
let t = y % 10
let s = s + p[t]
let y = int(y / 10)
endif
wait
loop y > 0
if s = x then
print x
let c = c + 1
endif
let x = x + 1
endif
loop c < n
end