Const n = 5; var i, j, total_p, total_o: integer; a: array[1..n, 1..n] of integer; begin for i := 1 to n do begin for j := 1 to n do begin a[i, j] := random(20) - 10; write(a[i, j]:3); if(a[i, j] < 0) then inc(total_o) else inc(total_p); end; writeln; end; writeln('Кол-во положительных эл-тов: ', total_p); writeln('Кол-во отрицательных эл-тов: ', total_o); end.
var i, j, total_p, total_o: integer;
a: array[1..n, 1..n] of integer;
begin
for i := 1 to n do begin
for j := 1 to n do begin
a[i, j] := random(20) - 10;
write(a[i, j]:3);
if(a[i, j] < 0) then inc(total_o)
else inc(total_p);
end;
writeln;
end;
writeln('Кол-во положительных эл-тов: ', total_p);
writeln('Кол-во отрицательных эл-тов: ', total_o);
end.