// yukicoder: No.207 世界のなんとか // 2019.4.12 bal4u #include #include int main() { int A, B, a, s, t; scanf("%d%d", &A, &B); while (A <= B) { s = 0, a = A; while (a) { t = a % 10, a /= 10; s += t; if (t == 3) goto ok; } if (s % 3 == 0) { ok: printf("%d\n", A); } A++; } return 0; }