#include #include bool include_three(int num) { std::string num_str(std::to_string(num)); return (num_str.find("3") != std::string::npos); } int main(int argc, char *argv[]) { int start_num = 0; int end_num = 0; std::cin >> start_num; std::cin >> end_num; for (int i = start_num; i <= end_num; i++) { if ((i % 3 == 0) or include_three(i)) { std::cout << i << std::endl; } } return 0; }