42 lines
1.1 KiB
Text
42 lines
1.1 KiB
Text
call eban (2, 1000, 1)
|
|
call eban (1000, 4000, 1)
|
|
call eban (2, 10000, 0)
|
|
call eban (2, 100000, 0)
|
|
call eban (2, 1000000, 0)
|
|
call eban (2, 10000000, 0)
|
|
call eban (2, 100000000, 0)
|
|
print "Run time: " + (Msec/1000) + " seconds."
|
|
end
|
|
|
|
subroutine eban (start, ended, printable)
|
|
contar = 0
|
|
if start = 2 then
|
|
print "eban numbers up to and including "; ended; ":"
|
|
else
|
|
print "eban numbers between "; start; " and "; ended; " (inclusive):"
|
|
end if
|
|
|
|
for i = start to ended step 2
|
|
b = int(i / 1000000000)
|
|
r = (i % 1000000000)
|
|
m = int(r / 1000000)
|
|
r = (i % 1000000)
|
|
t = int(r / 1000)
|
|
r = (r % 1000)
|
|
if m >= 30 and m <= 66 then m = (m % 10)
|
|
if t >= 30 and t <= 66 then t = (t % 10)
|
|
if r >= 30 and r <= 66 then r = (r % 10)
|
|
if b = 0 or b = 2 or b = 4 or b = 6 then
|
|
if m = 0 or m = 2 or m = 4 or m = 6 then
|
|
if t = 0 or t = 2 or t = 4 or t = 6 then
|
|
if r = 0 or r = 2 or r = 4 or r = 6 then
|
|
if printable then print i + " ";
|
|
contar += 1
|
|
end if
|
|
end if
|
|
end if
|
|
end if
|
|
next i
|
|
if printable then print
|
|
print "count = "; contar & chr(10)
|
|
end subroutine
|