function isPrime(num: integer): boolean;
begin
result := num > 1 ? true : false;
for var i := 2 to (num div 2) do
if (num mod i = 0) then
result := false;
break
end;
var list := new List<integer>;
var (n, i) := (40, 0);
var count := 0;
while (n < 61) do
if isPrime(n) then
list.Add(n);
count += 1;
n += 1;
list.Println;
writelnFormat('Count = {0}', Count);
end.
function isPrime(num: integer): boolean;
begin
result := num > 1 ? true : false;
for var i := 2 to (num div 2) do
if (num mod i = 0) then
begin
result := false;
break
end;
end;
begin
var list := new List<integer>;
var (n, i) := (40, 0);
var count := 0;
while (n < 61) do
begin
if isPrime(n) then
begin
list.Add(n);
count += 1;
end;
n += 1;
end;
list.Println;
writelnFormat('Count = {0}', Count);
end.