Var m,n:byte;
A:array[1..100,1..100] of integer;
Procedure Form;
Var I,j:byte;
Begin
Randomize;
For I:=1 to n do
For j:=1 to m do
A[i,j]:=random(280)-120;
End;
Procedure Viv;
Var I,j:byte;
Begin
For I:=1 to n do
Begin
Writeln;
For j:=1 to m do
Write(a[i,j]:5); End;
End;
Procedure saj;
Var i,j,k,b:integer;
begin
writeln;
writeln;
for b:=1 to n do
for i:=1 to n do
for j:=1 to m-1 do
if a[i,j] k:=a[i,j]; a[i,j]:=a[i,j+1]; a[i,j+1]:=k; end;
for b:=1 to n do
for i:=2 to n do
for j:=1 to m-1 do
if a[i,j] k:=a[i,j]; a[i,j]:=a[i,j+1]; a[i,j+1]:=k; end;
for b:=1 to n do
for i:=3 to n do
for j:=1 to m-1 do
if a[i,j] k:=a[i,j]; a[i,j]:=a[i,j+1]; a[i,j+1]:=k; end;
for b:=1 to n do
for i:=4 to n do
for j:=1 to m-1 do
if a[i,j] k:=a[i,j]; a[i,j]:=a[i,j+1]; a[i,j+1]:=k; end;
for b:=1 to n do
for i:=5 to n do
for j:=1 to m-1 do
if a[i,j] k:=a[i,j]; a[i,j]:=a[i,j+1]; a[i,j+1]:=k; end;
for i:=1 to n do begin
for j:=1 to m do
Write(a[i,j]:5);
writeln;
end;
end;
Begin
Readln(n,m);
Form; Viv;
saj;
Readln
End.
Записать в файл исходную и преобразованную матрицы! Как это сделать не могу понять?