# 入力された値を文字列で受け取る input = gets.chomp xmin, xmax = input.split a = xmin.to_i b = xmax.to_i c = b - a + 1 c.times do |i| puts i if (i + a) % 3 == 0 # puts i + a elsif (i + a).to_s.include?("3") # puts i + a end end