Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab1v8n3;
- var
- a:array[1..4,1..7]of Integer;
- // here it is like
- // 1 2 3 4 5 6 7
- // 1 2 3 4 5 6 7
- // 1 2 3 4 5 6 7
- // 1 2 3 4 5 6 7
- procedure ProcessData;
- var i,j,min_i,min_j:Word;
- b:array[1..7]of Integer;
- begin
- min_i:=1;
- min_j:=1;
- for i:=1 to 4 do
- for j:=1 to 7 do
- if a[i,j]<a[min_i,min_j]
- then begin
- min_i:=i;
- min_j:=j;
- end;
- for j:=1 to 7 do
- begin
- b[j]:=a[min_i,j];
- a[min_i,j]:=a[4,j];
- a[4,j]:=b[j];
- end;
- end;
- procedure ImportData;
- var i,j:Integer;
- begin
- for i:=1 to 4 do
- for j:=1 to 7 do
- Read(a[i,j]);
- end;
- procedure ExportData;
- var i,j:Integer;
- begin
- for i:=1 to 4 do
- begin
- for j:=1 to 7 do
- Write(a[i,j],' ');
- WriteLn;
- end;
- end;
- //main
- begin
- ImportData;
- ProcessData;
- ExportData;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement