#include #include using namespace std; bool doesHaveThree(int n){ while(n > 0){ if(n % 10 == 3) return true; n /= 10; } return false; } void solve(int a, int b){ for(int i = a; i <= b; i++){ if(i % 3 == 0 || doesHaveThree(i)) cout << i << endl; } } int main(){ int A, B; cin >> A >> B; solve(A, B); }