RosettaCodeData/Task/Self-describing-numbers/Run-BASIC/self-describing-numbers.basic
2023-07-01 13:44:08 -04:00

17 lines
310 B
Text

for i = 0 to 50000000 step 10
a$ = str$(i)
for c = 1 TO len(a$)
d = val(mid$(a$, c, 1))
j(d) = j(d) + 1
k(c-1) = d
next c
r = 0
for n = 0 to 10
r = r + (j(n) = k(n))
j(n) = 0
k(n) = 0
next n
if r = 11 then print i
next i
print "== End =="
end