program sort_3b

!-- read in three real numbers and print them in ascending order

  implicit none
  integer :: i, j
  real :: n1, n2

  call sort_the_numbers
  
  contains
  
  subroutine sort_the_numbers
  
  do i = 1,10000
  do j = i,10000
!-- sort the numbers
    n1 = i; n2 = j
    call swap (n1, n2)
  enddo
  enddo
  
  end subroutine sort_the_numbers

  
  subroutine swap(a,b)
  
  real :: a, b, temp
  
  if(a > b) then
  temp = a
  a = b
  b = temp
  endif
  
  end subroutine swap
  
end program sort_3b
