RosettaCodeData/Task/Gapful-numbers/Run-BASIC/gapful-numbers.basic

29 lines
539 B
Plaintext

call muestraGapful 100, 30
call muestraGapful 1000000, 15
call muestraGapful 1000000000, 10
call muestraGapful 7123,25
end
function isGapful(n)
m = n
l = n mod 10
while (m >= 10)
m = int(m / 10)
wend
isGapful = (m * 10) + l
end function
sub muestraGapful n, gaps
inc = 0
print
print "First "; gaps; " gapful numbers >= "; n
while inc < gaps
if n mod isGapful(n) = 0 then
print " " ; n ;
inc = inc + 1
end if
n = n + 1
wend
print
end sub