Определить все простые двузначные числа. Есть предположение, что решается именно так, помогите пожалуйста составить блок-схему.

Program example14;

Var i:

integer; function prost(i: integer): boolean;

var j:integer;

begin prost := true; i:=abs(i); for j := 2 to (i div 2) do if (i mod j = 0) then prost := false; end;

begin for i := 10 to 99 do if prost(i) = true then write(i:5);

readln(i);

end.

var prost: array [1..100] of integer;
  i, max, n, j: integer;
  is_prost:bool;
Begin
  max := 99;
  prost[1] := 2;
  n := 1;
  for i := 2 to max do begin
    is_prost := true;
    for j := 1 to n do begin
      is_prost := is_prost and not (i mod prost[j] = 0);
    end;
    if is_prost then begin
      n := n + 1;
      prost[n] := i;
    end;
  end;

  for i := 1 to n do
    if prost[i] > 9 then write(prost[i], );
End.

Оцени ответ
Подпишись на наш канал в телеграм. Там мы даём ещё больше полезной информации для школьников!

Загрузить картинку