program main implicit none integer::N,nama integer,allocatable::H(:) integer::rank character*2::suffix="th" read *,nama, N allocate(H(1:N-1)) read *,H rank = COUNT(nama.lt.H(:)) + 1 if (MOD(rank,10).eq.1) then suffix="st" else if(MOD(rank,10).eq.2) then suffix="nd" else if(MOD(rank,10).eq.3) then suffix="rd" end if print '(i0,a)',rank,suffix end program main