Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,27 @@
$ include "seed7_05.s7i";
const func boolean: semiPrime (in var integer: n) is func
result
var boolean: isSemiPrime is TRUE;
local
var integer: p is 2;
var integer: f is 0;
begin
while f < 2 and p**2 <= n do
while n rem p = 0 do
n := n div p;
incr(f);
end while;
incr(p);
end while;
isSemiPrime := f + ord(n > 1) = 2;
end func;
const proc: main is func
local
var integer: v is 0;
begin
for v range 1675 to 1680 do
writeln(v <& " -> " <& semiPrime(v));
end for;
end func;