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

정답

#!/usr/bin/ruby require 'scanf' limit = 0 set = [] index = -1 loop do print "배열에 추가할 원소? " value = scanf("%d") for i in 0...limit if value == set[i] index = i end end if (index == -1) set << value puts value limit += 1 break if limit == 10 else puts "해당 원소가 이미 [#{index}]에 존재합니다." index = -1 end end