const
n=5;
var
i,j,maxi,maxj:integer;
a:array [1..n,1..n] of integer;
b:array of integer;
begin
maxi:=1; maxj:=1;
for i:=1 to n do
for j:=1 to n do
a[i,j]:=random(101)-50;
write(a[i,j]:4);
if a[i,j]>a[maxi,maxj] then
maxi:=i;
maxj:=j;
end;
writeln;
writeln('Строка: ', maxi);
j:=1; i:=1;
repeat
if a[maxi,j] >0 then
setlength(b,i);
b[i-1]:=a[maxi,j];
inc(i);
inc(j);
until j>n;
for j:=0 to length(b)-1 do
write(b[j]:4);
b:=nil;
end.
const
n=5;
var
i,j,maxi,maxj:integer;
a:array [1..n,1..n] of integer;
b:array of integer;
begin
maxi:=1; maxj:=1;
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(101)-50;
write(a[i,j]:4);
if a[i,j]>a[maxi,maxj] then
begin
maxi:=i;
maxj:=j;
end;
end;
writeln;
end;
writeln;
writeln('Строка: ', maxi);
j:=1; i:=1;
repeat
if a[maxi,j] >0 then
begin
setlength(b,i);
b[i-1]:=a[maxi,j];
inc(i);
end;
inc(j);
until j>n;
for j:=0 to length(b)-1 do
write(b[j]:4);
b:=nil;
end.