Эта задача на нахождение суммы отриц. элементов Const N=7; К=5; Var a: array [1..N, 1..К] of integer; i, j, y : integer; Begin for i:=1 to N do for j:=1 to K do readln(a[i,j]); у:=0; for i:=1 to N do for j:=1 to K do If (a[i,j]<0) then y:=y+ a[i,j]; writeln (y); End.
Var i,j,s,min,im:integer; a:array[1..7,1..5]of integer; begin for i:=1 to 7 do begin for j:=1 to 5 do begin a[i,j]:=random(-9,9); write(a[i,j]:4); end; writeln; end; writeln('Сумма отрицательных по столбцам:'); for j:=1 to 5 do begin for i:=1 to 7 do if a[i,j]<0 then s:=s+a[i,j]; write(s:4); s:=0; end; min:=a[1,1]; for j:=1 to 5 do begin if (a[1,j]<min) then begin min:=a[1,j]; im:=j; end; end; writeln; writeln('Min=',min,'; (1,',im,')'); end.
Const
N=7; К=5;
Var a: array [1..N, 1..К] of integer;
i, j, y : integer;
Begin
for i:=1 to N do
for j:=1 to K do readln(a[i,j]);
у:=0;
for i:=1 to N do for j:=1 to K do
If (a[i,j]<0) then
y:=y+ a[i,j];
writeln (y);
End.
i,j,s,min,im:integer;
a:array[1..7,1..5]of integer;
begin
for i:=1 to 7 do
begin
for j:=1 to 5 do
begin
a[i,j]:=random(-9,9);
write(a[i,j]:4);
end;
writeln;
end;
writeln('Сумма отрицательных по столбцам:');
for j:=1 to 5 do
begin
for i:=1 to 7 do
if a[i,j]<0 then s:=s+a[i,j];
write(s:4);
s:=0;
end;
min:=a[1,1];
for j:=1 to 5 do
begin
if (a[1,j]<min) then
begin
min:=a[1,j];
im:=j;
end;
end;
writeln;
writeln('Min=',min,'; (1,',im,')');
end.