Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
include "ConsoleWindow"
|
||||
|
||||
def tab 6
|
||||
|
||||
local fn isPrime( n as long ) as Boolean
|
||||
dim as long i
|
||||
dim as Boolean result
|
||||
|
||||
if n < 2 then result = _false : exit fn
|
||||
if n = 2 then result = _true : exit fn
|
||||
if n mod 2 == 0 then result = _false : exit fn
|
||||
result = _true
|
||||
for i = 3 to int( n^.5 ) step 2
|
||||
if n mod i == 0 then result = _false : exit fn
|
||||
next i
|
||||
end fn = result
|
||||
|
||||
dim as long i, j
|
||||
|
||||
print "Prime numbers between 0 and 1000:"
|
||||
for i = 0 to 1000
|
||||
if ( fn isPrime(i) != _false )
|
||||
print i, : j++
|
||||
if j mod 10 == 0 then print
|
||||
end if
|
||||
next
|
||||
Loading…
Add table
Add a link
Reference in a new issue