Program vvv2; uses crt; const n=5; const m=6; var a:array[1..n,1..m] of integer; st:array[1..n] of integer;//массив для хранения столбца i,j,nomer,min : integer; begin Randomize; for i:=1 to n do for j:=1 to m do a[i,j]:= Random(100); //заполняем массив writeln; writeln('Начальный массив:'); for i:=1 to n do begin for j:=1 to m do write(a[i,j]:5);//выводим массив writeln; end; writeln('*** alphaues is thinking... ***'); for i:=1 to n do begin st[i]:=a[i,1]; a[i,1]:=a[i,m]; a[i,m]:= st[i]; end; writeln; writeln('Результат:'); for i:=1 to n do begin for j:=1 to m do write(a[i,j]:5);//выводим массив writeln; end; end.
Program vvv2;
uses crt;
const n=5;
const m=6;
var
a:array[1..n,1..m] of integer;
st:array[1..n] of integer;//массив для хранения столбца
i,j,nomer,min : integer;
begin
Randomize;
for i:=1 to n do
for j:=1 to m do
a[i,j]:= Random(100); //заполняем массив
writeln;
writeln('Начальный массив:');
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:5);//выводим массив
writeln;
end;
writeln('*** alphaues is thinking... ***');
for i:=1 to n do
begin
st[i]:=a[i,1];
a[i,1]:=a[i,m];
a[i,m]:= st[i];
end;
writeln;
writeln('Результат:');
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:5);//выводим массив
writeln;
end;
end.
var
a:array [1..5,1..6] of integer;
i,j,buf:integer;
begin
randomize;
for i:=1 to 5 do begin
for j:=1 to 6 do begin
a[i,j]:=random(8)+2;
write (a[i,j],' ');
end;
writeln;
end;
for i:=1 to 5 do begin
buf:=a[i,1];
a[i,1]:=a[i,6];
a[i,6]:=buf;
end;
writeln;
for i:=1 to 5 do begin
for j:=1 to 6 do write (a[i,j],' ');
writeln;
end;
readln;
end.