#include #include int san(const int temp){ int a = temp; while(a > 0){ if(a % 10 == 3){ printf("%d",temp); goto END; } else a /= 10; } END: return 0; } int main(void){ int a, b; scanf("%d%d", &a, &b); for(; a <= b; a++) switch(a % 3){ case 0 : printf("%d",a); break; case 1 : san(a); break; case 2 : san(a); break; } return 0; }