#include using namespace std; int trans(int i, int base) { int result = 0; for (; i;) { result += i % base; i /= base; } return result; } int main() { for (int i = 2992; i <= 9999; i++) { if (trans(i, 10) == trans(i, 12) && trans(i, 10) == trans(i, 16)) { cout << i << endl; } } return 0; }