문제 https://gall.dcinside.com/mgallery/board/view/?id=github&no=8217&page=1




도대체 머가 문제야 씨빨 나 진짜 2시간동안 이것만 잡고있는데도 못풀게썽 제발 ㅂ뭐가 문젠지좀알려주라 씨빨 죽고싶다



정답
program github_moron use :: iso_fortran_env, only : Int32, output_unit, input_unit implicit none logical :: has integer(kind=Int32) :: i, n, input, ierr integer(kind=Int32), parameter :: sz = 10 integer(kind=Int32), dimension(sz) :: set n = 0 do while(n /= sz) 100 write(output_unit, '(A)') "배열에 추가할 원소?" read(input_unit, *, iostat = ierr ) input if ( ierr /= 0 ) goto 100 has = .false. do i = 1, n if(input == set(i)) then has = .true. exit end if end do if (has) then write(output_unit, '(A,I0,A)') & "해당 원소가 이미 [", i, "]에 존재합니다." else set(i) = input n = n + 1 end if end do end program



번외