Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Var
- a:array [1..5, 1..6] of integer;
- this_row_maximum,k,i,j:integer;
- output_array:array [1..6] of integer;
- next_output_index:integer;
- procedure write_back(value_: integer);
- begin
- output_array[next_output_index] := value_;
- next_output_index := next_output_index + 1;
- end;
- Begin
- For i:=1 to 5 do begin
- for j:=1 to 6 do begin
- a[i,j]:=random(20)-10;
- write(a[i,j]:4, ' ');
- end;
- writeln;
- end;
- next_output_index := 1;
- for j := 1 to 6 do
- begin
- this_row_maximum := abs(a[i, j]);
- for i := 1 to 5 do
- begin
- if abs(a[i, j]) > this_row_maximum then
- this_row_maximum := abs(a[i, j]);
- end;
- write_back(this_row_maximum); { ---------------------------- }
- end;
- writeln;
- writeln;
- writeln;
- for i := 1 to 6 do
- begin
- write(output_array[i]:4, ' ');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement