27 lines
532 B
Plaintext
27 lines
532 B
Plaintext
100 cls
|
|
110 sub isdisarium(n)
|
|
120 digitos = len(str$(n))
|
|
130 suma = 0
|
|
140 x = n
|
|
150 while x <> 0
|
|
160 r = (x mod 10)
|
|
170 suma = suma+(r^digitos)
|
|
180 digitos = digitos-1
|
|
190 x = int(x/10)
|
|
200 wend
|
|
210 if suma = n then isdisarium = true else isdisarium = false
|
|
220 end sub
|
|
230 '
|
|
240 limite = 19
|
|
250 cnt = 0
|
|
260 n = 0
|
|
270 print "The first ";limite;" Disarium numbers are:"
|
|
280 while cnt < limite
|
|
290 if isdisarium(n) then
|
|
300 print n;" ";
|
|
310 cnt = cnt+1
|
|
320 endif
|
|
330 n = n+1
|
|
340 wend
|
|
350 end
|