Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 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. Begin
  9. For i:=1 to 5 do begin
  10. for j:=1 to 6 do begin
  11. a[i,j]:=random(20)-10;
  12. write(a[i,j]:4, ' ');
  13. end;
  14. writeln;
  15. end;
  16.  
  17. next_output_index := 1;
  18.  
  19. for j := 1 to 6 do
  20. begin
  21. this_row_maximum := abs(a[i, j]);
  22.  
  23. for i := 1 to 5 do
  24. begin
  25. if abs(a[i, j]) > this_row_maximum then
  26. this_row_maximum := abs(a[i, j]);
  27. end;
  28.  
  29. output_array[next_output_index] := this_row_maximum;
  30. next_output_index := next_output_index + 1;
  31. end;
  32.  
  33. writeln;
  34. writeln;
  35. writeln;
  36. for i := 1 to 6 do
  37. begin
  38. write(output_array[i]:4, ' ');
  39. end;
  40.  
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement