real*8 :: a(n)real*8 :: tempinteger :: i,jdo i=1,n-1 do j=i+1,n if (a(i) .lt. a(j)) then temp = a(i) a(i) = a(j) a(j) = temp endif enddoenddo