const
n=6;
m=8;
var
a : array [0..m, 0..n] of integer;
i, j, SPlus : integer;
begin
writeln('Матрица А');
randomize;
SPlus := 0;
for i:=0 to m-1 do begin
for j:=0 to n-1 do begin
a[i,j] := random(100)-50;
if a[i, j]>0 then inc(SPlus);
write(a[i, j], ' ');
end;
writeln();
Writeln('Кол-во элементов > 0 =', SPlus);
end.
n=7;
m=3;
a, b, c : array [0..n, 0..m] of integer;
i, j, min, SPlus, Ip,Jp : integer;
for j:=0 to m-1 do begin
for i:=0 to n-1 do begin
b[i,j] := random(100)-50;
Writeln('Матрица B');
SPlus := -100;
c[i,j]:= a[i,j]+b[i,j];
if SPlus<c[i,j] then begin
SPlus := c[i,j];
Ip := i;
Jp := j
write(b[i, j], ' ');
writeln('--------------------');
writeln('C[',Ip, ',', Jp,']=', SPlus);
const
n=6;
m=8;
var
a : array [0..m, 0..n] of integer;
i, j, SPlus : integer;
begin
writeln('Матрица А');
randomize;
SPlus := 0;
for i:=0 to m-1 do begin
for j:=0 to n-1 do begin
a[i,j] := random(100)-50;
if a[i, j]>0 then inc(SPlus);
write(a[i, j], ' ');
end;
writeln();
end;
Writeln('Кол-во элементов > 0 =', SPlus);
end.
const
n=7;
m=3;
var
a, b, c : array [0..n, 0..m] of integer;
i, j, min, SPlus, Ip,Jp : integer;
begin
writeln('Матрица А');
randomize;
SPlus := 0;
for j:=0 to m-1 do begin
for i:=0 to n-1 do begin
a[i,j] := random(100)-50;
b[i,j] := random(100)-50;
write(a[i, j], ' ');
end;
writeln();
end;
writeln();
Writeln('Матрица B');
SPlus := -100;
for j:=0 to m-1 do begin
for i:=0 to n-1 do begin
c[i,j]:= a[i,j]+b[i,j];
if SPlus<c[i,j] then begin
SPlus := c[i,j];
Ip := i;
Jp := j
end;
write(b[i, j], ' ');
end;
writeln();
end;
writeln('--------------------');
writeln('C[',Ip, ',', Jp,']=', SPlus);
end.