def three(n : Int32) : Bool while n > 0 return true if n % 10 == 3 n /= 10 end false end a = gets.not_nil!.to_i b = gets.not_nil!.to_i (a..b).each do |i| puts i if i % 3 == 0 || three(i) end