integer::A(5),i integer::card(13) integer::num(5) integer::three=0,two=0 character*16::res data card/13*0/, num/5*0/ read *,A do i=1,5 card(A(i)) = card(A(i)) + 1 end do do i=1,13 if(card(i).eq.3) then three = three + 1 else if(card(i).eq.2) then two = two + 1 end if end do if (three.eq.1) then if(two.eq.1 ) then res = 'FULL HOUSE' else res = 'THREE CARD' end if else if(two.eq.2) then res = 'TWO PAIR' else if(two.eq.1) then res = 'ONE PAIR' else res = 'NO HAND' end if print '(a)', TRIM(res) end program