June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
13
Task/Semiprime/Lingo/semiprime-1.lingo
Normal file
13
Task/Semiprime/Lingo/semiprime-1.lingo
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
on isSemiPrime (n)
|
||||
div = 2
|
||||
cnt = 0
|
||||
repeat while cnt < 3 and n <> 1
|
||||
if n mod div = 0 then
|
||||
n = n / div
|
||||
cnt = cnt + 1
|
||||
else
|
||||
div = div + 1
|
||||
end if
|
||||
end repeat
|
||||
return cnt=2
|
||||
end
|
||||
5
Task/Semiprime/Lingo/semiprime-2.lingo
Normal file
5
Task/Semiprime/Lingo/semiprime-2.lingo
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
res = []
|
||||
repeat with i = 1 to 100
|
||||
if isSemiPrime(i) then res.add(i)
|
||||
end repeat
|
||||
put res
|
||||
Loading…
Add table
Add a link
Reference in a new issue