문제 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
번외
포트란 너무 무섭다
이미 삭튀끝 ㅅㅅ
해당 댓글은 삭제되었습니다.
https://open.kakao.com/o/sYlklvSb
복각추
어케 복각함;;
이런 형식으로 박제하는거 괜찮다 ㅋㅋㅋㅋ
왜 도와줌 도대체