25 lines
498 B
Text
25 lines
498 B
Text
100 rem Narcissistic decimal number
|
|
110 n = 25
|
|
120 dim power(9)
|
|
130 for i = 0 to 9
|
|
140 power(i) = i
|
|
150 next i
|
|
160 limit = 10
|
|
170 cnt = 0 : x = 0
|
|
180 while cnt < n
|
|
190 if x >= limit then
|
|
200 for i = 0 to 9
|
|
210 power(i) = power(i)*i
|
|
220 next i
|
|
230 limit = limit*10
|
|
240 endif
|
|
250 sum = 0 : xx = x
|
|
260 while xx > 0
|
|
270 sum = sum+power(xx mod 10)
|
|
280 xx = int(xx/10)
|
|
290 wend
|
|
300 if sum = x then print x; : cnt = cnt+1
|
|
310 x = x+1
|
|
320 wend
|
|
330 print
|
|
340 end
|