Const n=10; m=10; var A: array [1..n,1..m] of integer; s, k, i, j: integer; begin randomize; for i:= 1 to n do begin for j:= 1 to m do begin A[i,j]:= -100 + random (100); write (A[i,j]: 5); end; writeln; end; for i:= 1 to n do begin s:=0; k:=0; for j:= 1 to m do if A[i,j] < 0 then begin s:=s+A[i,j]; k:=k+1; end; writeln('в строке', i, ' отрицательных элементов' , k, ' s отрицат. = ', s); end; end.
m=10;
var A: array [1..n,1..m] of integer;
s, k, i, j: integer;
begin
randomize;
for i:= 1 to n do
begin
for j:= 1 to m do
begin
A[i,j]:= -100 + random (100);
write (A[i,j]: 5);
end;
writeln;
end;
for i:= 1 to n do
begin
s:=0;
k:=0;
for j:= 1 to m do
if A[i,j] < 0 then
begin
s:=s+A[i,j];
k:=k+1;
end;
writeln('в строке', i, ' отрицательных элементов' , k, ' s отрицат. = ', s);
end;
end.