1)
var
a:array [1..5,1..10] of integer;
i,j,p:integer;
begin
for i:=1 to 5 do
begin
for j:=1 to 10 do
begin
a[i,j]:=random(50)+1;
write(a[i,j]:3);
end;
writeln;
end;
writeln('меняем 1 и последнюю строки');
for j:=1 to 10 do
begin
p:=a[1,j];
a[1,j]:=a[5,j];
a[5,j]:=p;
end;
for i:=1 to 5 do
begin
for j:=1 to 10 do
write(a[i,j]:3);
writeln;
end;
end.
2)
var
a: array [1..5, 1..10] of integer;
i, j: integer;
p: real;
begin
for i := 1 to 5 do
begin
for j := 1 to 10 do
begin
a[i, j] := random(50) + 1;
write(a[i, j]:3);
end;
writeln;
end;
writeln('произведения элементов строк');
for i := 1 to 5 do
begin
p := 1;
for j := 1 to 10 do
p := p * a[i, j];
writeln(p:25:0);
end;
end.