Spicke

1

Jan 18th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.54 KB | None | 0 0
  1. const n = 4;
  2.  
  3. var a: array[1..n,1..n] of real;
  4.     i,j,imax,jmax: integer;
  5.  
  6. begin
  7.     randomize;
  8.     for i := 1 to n do
  9.     begin
  10.         for j := 1 to n do
  11.         begin
  12.             a[i,j] := random(5);
  13.             write(a[i,j]:2)
  14.         end;
  15.         writeln
  16.     end;
  17.     writeln;
  18.    
  19.    
  20.     imax := 1; jmax := 1;
  21.     for i := 1 to n do
  22.       for j := 1 to n+1-i do
  23.         if a[i,j] > a[imax,jmax] then
  24.         begin
  25.           imax := i;
  26.           jmax := j;
  27.         end;
  28.    
  29.     writeln(a[imax,jmax]:2)
  30. end.
Advertisement
Add Comment
Please, Sign In to add comment