Function Simple(a: integer): boolean; begin result := true; for i: integer := 2 to (a div 2) do if (a mod i = 0) then begin result := false; break; end; end;
const n = 10;
var i: longint := 1; j: longint; a: array [1..n] of longint;
begin while (a[n] = 0) do begin
while (a[i] = 0) do begin j += 1; if (Simple(j)) then begin a[i] := j; end; end; i += 1; end; for i := 1 to n do write(a[i], ' '); end.
begin
result := true;
for i: integer := 2 to (a div 2) do
if (a mod i = 0) then
begin
result := false;
break;
end;
end;
const
n = 10;
var
i: longint := 1;
j: longint;
a: array [1..n] of longint;
begin
while (a[n] = 0) do
begin
while (a[i] = 0) do
begin
j += 1;
if (Simple(j)) then
begin
a[i] := j;
end;
end;
i += 1;
end;
for i := 1 to n do
write(a[i], ' ');
end.