Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
50
Task/Eban-numbers/FutureBasic/eban-numbers.basic
Normal file
50
Task/Eban-numbers/FutureBasic/eban-numbers.basic
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
void local fn Eban( start as NSUInteger, finish as NSUInteger, printable as BOOL )
|
||||
NSUInteger i, b, r, m, t, count
|
||||
|
||||
if ( start = 2 )
|
||||
printf @"eban numbers up to and including %lu", finish
|
||||
else
|
||||
printf @"eban numbers between %lu and %lu:", start, finish
|
||||
end if
|
||||
|
||||
count = 0
|
||||
for i = start to finish step 2
|
||||
b = int(i / 100000000)
|
||||
r = i % 100000000
|
||||
m = int(r / 1000000)
|
||||
r = i % 1000000
|
||||
t = int(r / 1000)
|
||||
r = r % 1000
|
||||
if m >= 30 && m <= 66 then m = (m % 10)
|
||||
if t >= 30 && t <= 66 then t = (t % 10)
|
||||
if r >= 30 && r <= 66 then r = (r % 10)
|
||||
if b = 0 || b = 2 || b = 4 || b = 6
|
||||
if m = 0 || m = 2 || m = 4 || m = 6
|
||||
if t = 0 || t = 2 || t = 4 || t = 6
|
||||
if r = 0 || r = 2 || r = 4 || r = 6
|
||||
if printable == YES then printf @"%lu \b", i
|
||||
count++
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
next
|
||||
if printable == YES then print
|
||||
printf @"%lu eban numbers found\n", count
|
||||
end fn
|
||||
|
||||
void local fn EbanNumbers
|
||||
CFTimeInterval t = fn CACurrentMediaTime
|
||||
fn Eban( 2, 1000, YES )
|
||||
fn Eban( 1000, 4000, YES )
|
||||
fn Eban( 2, 10000, NO )
|
||||
fn Eban( 2, 100000, NO )
|
||||
fn Eban( 2, 1000000, NO )
|
||||
fn Eban( 2, 10000000, NO )
|
||||
fn Eban( 2, 100000000, NO )
|
||||
printf @"Compute time: %.3f sec\n", fn CACurrentMediaTime - t
|
||||
end fn
|
||||
|
||||
fn EbanNumbers
|
||||
|
||||
HandleEvents
|
||||
54
Task/Eban-numbers/OxygenBasic/eban-numbers.basic
Normal file
54
Task/Eban-numbers/OxygenBasic/eban-numbers.basic
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
uses console
|
||||
|
||||
! GetTickCount lib "kernel32.dll"
|
||||
double t1, t2
|
||||
|
||||
sub eban (start as int, ended as int, printable as int)
|
||||
int contar
|
||||
long i, b, r, m, t
|
||||
|
||||
contar = 0
|
||||
if start = 2 then
|
||||
printl "eban numbers up to and including " ended ":"
|
||||
else
|
||||
printl "eban numbers between " start " and " ended " (inclusive):"
|
||||
end if
|
||||
|
||||
for i = start to ended step 2
|
||||
b = (i \ 1000000000)
|
||||
r = mod(i, 1000000000)
|
||||
m = (r \ 1000000)
|
||||
r = mod(i, 1000000)
|
||||
t = (r \ 1000)
|
||||
r = mod(r, 1000)
|
||||
if m >= 30 and m <= 66 then m = mod(m, 10)
|
||||
if t >= 30 and t <= 66 then t = mod(t, 10)
|
||||
if r >= 30 and r <= 66 then r = mod(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 cr
|
||||
printl "count = " contar cr
|
||||
end sub
|
||||
|
||||
t1 = GetTickCount
|
||||
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)
|
||||
t2 = GetTickCount
|
||||
printl "Run time: " (t2-t1)/1000 " seconds."
|
||||
|
||||
printl cr "Enter ..."
|
||||
waitkey
|
||||
Loading…
Add table
Add a link
Reference in a new issue