[Ruby][백준] X보다 작은 수 (10871)

PersesTitan·2022년 6월 11일
0

RubyBaekJoon

목록 보기
32/46

반복문

풀이 : 10은 받을 숫자의 갯수, 5는 비교 값입니다.

코드 경고선


코드

count = gets.chomp
value = gets.chomp.split(" ")

number = count.split(" ")

(0..number[0].to_i-1).each do|i|
  if value[i].to_i < number[1].to_i
    print "#{value[i].to_i} "
  end
end

코드 링크

profile
안녕하세요 페르세스 티탄입니다! 부족한 부분이 많이 있겠지만 잘부탁드립니다.

0개의 댓글