Narcissistic decimal number: Difference between revisions

Content added Content deleted
Line 761: Line 761:
0 1 2 3 4 5 6 7 8 9 153 370 371 407 1634 8208 9474 54748 92727 93084 548834 1741725 4210818 9800817 9926315
0 1 2 3 4 5 6 7 8 9 153 370 371 407 1634 8208 9474 54748 92727 93084 548834 1741725 4210818 9800817 9926315
</pre>
</pre>

==={{header|Craft Basic}}===
<syntaxhighlight lang="basic">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</syntaxhighlight>


==={{header|FreeBASIC}}===
==={{header|FreeBASIC}}===