program soppchm;
uses
crt;
var
a: array [1..40] of Integer;
i: integer;
begin
for i := 1 to 40 do
a[i] := random(21) - 10;
writeln('a[', i, ']= ', a[i]);
end;
writeln('Положительные:');
if (a[i] >= 0) then
writeln('a[', i, ']= ', a[i]) ;
writeln('Отрицательные:');
if (a[i] < 0) then
readln;
end.
PascalABC.NET:
program soppchm;
uses
crt;
var
a: array [1..40] of Integer;
i: integer;
begin
for i := 1 to 40 do
begin
a[i] := random(21) - 10;
writeln('a[', i, ']= ', a[i]);
end;
writeln('Положительные:');
for i := 1 to 40 do
if (a[i] >= 0) then
writeln('a[', i, ']= ', a[i]) ;
writeln('Отрицательные:');
for i := 1 to 40 do
if (a[i] < 0) then
writeln('a[', i, ']= ', a[i]) ;
readln;
end.
PascalABC.NET:
###var a := ArrRandom(40, -10, 10);(a.Wh(x → x>0) + a.Wh(x → x<0)).Pr