Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. Var
  2. a:array [1..5, 1..6] of integer;
  3. this_row_maximum,k,i,j:integer;
  4.  
  5. output_array:array [1..6] of integer;
  6. next_output_index:integer;
  7.  
  8.  
  9. procedure write_back(value_: integer);
  10. begin
  11. output_array[next_output_index] := value_;
  12. next_output_index := next_output_index + 1;
  13. end;
  14.  
  15.  
  16. Begin
  17. For i:=1 to 5 do begin
  18. for j:=1 to 6 do begin
  19. a[i,j]:=random(20)-10;
  20. write(a[i,j]:4, ' ');
  21. end;
  22. writeln;
  23. end;
  24.  
  25. next_output_index := 1;
  26.  
  27. for j := 1 to 6 do
  28. begin
  29. this_row_maximum := abs(a[i, j]);
  30. for i := 1 to 5 do
  31. begin
  32. if abs(a[i, j]) > this_row_maximum then
  33. this_row_maximum := abs(a[i, j]);
  34. end;
  35.  
  36. write_back(this_row_maximum); { ---------------------------- }
  37. end;
  38.  
  39. writeln;
  40. writeln;
  41. writeln;
  42. for i := 1 to 6 do
  43. begin
  44. write(output_array[i]:4, ' ');
  45. end;
  46.  
  47. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement