Const n=5; m=6; var x:array[1..n,1..m] of integer; k:array[1..m] of integer; i,j,k0:integer; begin Randomize; For i:=1 to n do begin for j:=1 to m do begin x[i,j]:=Random(20)-10; write(x[i,j]:4); end; writeln; end; for j:=1 to m do begin k0:=0; for i:=1 to n do if x[i,j]<0 then k0:=k0+1; k[j]:=k0; end; writeln('Количество отрицательных элементов в столбцах:'); for j:=1 to m do write(k[j]:4); writeln; end.
var x:array[1..n,1..m] of integer;
k:array[1..m] of integer;
i,j,k0:integer;
begin
Randomize;
For i:=1 to n do begin
for j:=1 to m do begin
x[i,j]:=Random(20)-10;
write(x[i,j]:4);
end;
writeln;
end;
for j:=1 to m do begin
k0:=0;
for i:=1 to n do if x[i,j]<0 then k0:=k0+1;
k[j]:=k0;
end;
writeln('Количество отрицательных элементов в столбцах:');
for j:=1 to m do write(k[j]:4);
writeln;
end.