PROGRAM nyy
IMPLICIT NONE
INTEGER::n,i
INTEGER,ALLOCATABLE::a(:),b(:)
READ*,n
ALLOCATE (a(n),b(n))
READ*,a
DO i=1,n
b(i)=MINVAL(a)
a(MINLOC(a))=MAXVAL(a)
END DO
PRINT*,b
END
PROGRAM nyy
IMPLICIT NONE
INTEGER::n,i
INTEGER,ALLOCATABLE::a(:),b(:)
READ*,n
ALLOCATE (a(n),b(n))
READ*,a
DO i=1,n
b(i)=MINVAL(a)
a(MINLOC(a))=MAXVAL(a)
END DO
PRINT*,b
END