SHARE
TWEET

Untitled

a guest Feb 27th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program TEST
  2.     integer :: min_line, max_line
  3.     real    :: array(5, 4), min=999999, max=-999999, temp
  4.    
  5.     read (*,*) array
  6.    
  7.     do i = 1, 4
  8.      print *, array(:, i)
  9.     end do
  10.  
  11.     do i=1,4
  12.         do j=1, 5
  13.             if (array(j, i) > max) then
  14.                 max = array(j, i)
  15.                 max_line = i
  16.             end if
  17.             if (array(j, i) < min) then
  18.                 min = array(j, i)
  19.                 min_line = i
  20.             end if
  21.         end do
  22.     end do
  23.    
  24.     do i=1,5
  25.         temp = array(i, min_line)
  26.         array(i, min_line) = array(i, max_line)
  27.         array(i, max_line) = temp
  28.     end do
  29.    
  30.     print *
  31.    
  32.     do i = 1, 4
  33.      print *, array(:, i)
  34.     end do
  35.    
  36.     stop
  37. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top