Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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