var
A, Ap, Ao: array [1..14] of Integer;
i, c, cp, co: Integer;
s: Real;
begin
Randomize;
WriteLn ('Mассив:');
for i := Low (A) to High (A) do begin
A [i] := Random (201) - 100;
Write (A [i], ' ');
end;
cp := 0;
co := 0;
if A [i] > 0 then begin
cp := cp + 1;
Ap [cp] := A [i];
end else begin
co := co + 1;
Ao [co] := A [i];
c := Low (A);
for i := 1 to cp do begin
A [c] := Ap [i];
c := c + 1;
for i := 1 to co do begin
A [c] := Ao [i];
WriteLn;
WriteLn ('Результат: ');
WriteLn ('Количество положительных элементов массива = ', cp);
end.
var
A, Ap, Ao: array [1..14] of Integer;
i, c, cp, co: Integer;
s: Real;
begin
Randomize;
WriteLn ('Mассив:');
for i := Low (A) to High (A) do begin
A [i] := Random (201) - 100;
Write (A [i], ' ');
end;
cp := 0;
co := 0;
for i := Low (A) to High (A) do begin
if A [i] > 0 then begin
cp := cp + 1;
Ap [cp] := A [i];
end else begin
co := co + 1;
Ao [co] := A [i];
end;
end;
c := Low (A);
for i := 1 to cp do begin
A [c] := Ap [i];
c := c + 1;
end;
for i := 1 to co do begin
A [c] := Ao [i];
c := c + 1;
end;
WriteLn;
WriteLn ('Результат: ');
for i := Low (A) to High (A) do begin
Write (A [i], ' ');
end;
WriteLn;
WriteLn ('Количество положительных элементов массива = ', cp);
end.