Function isPrime(num : integer): boolean; begin result := true; for var i := 2 to num div 2 do if num mod i = 0 then begin result := false; break end; end;
begin var arr := new integer[30]; var (n, i) := (2, 0); while (i < 30) do begin if isPrime(n) then begin arr[ i ] := n; i+=1; end; n+=1; end; arr.Println; end.
begin
result := true;
for var i := 2 to num div 2 do
if num mod i = 0 then
begin
result := false;
break
end;
end;
begin
var arr := new integer[30];
var (n, i) := (2, 0);
while (i < 30) do
begin
if isPrime(n) then
begin
arr[ i ] := n;
i+=1;
end;
n+=1;
end;
arr.Println;
end.