###### tags: `CPE` # *2022/05/24 CPE_01* ## 題目: ![](https://i.imgur.com/mGNguLO.png) ``` #include <iostream> #include <vector> using namespace std; int main() { long long num_1, num_2; vector<long long> store; while (true) { store.clear(); cin >> num_1 >> num_2; store.push_back(num_1); if (num_1 != 0 && num_2 != 0 && num_2 != 1) { while (num_1 > 1) { store.push_back(num_1 / num_2); if (num_1 % num_2 != 0) { cout << "Boring!"; store.clear(); break; } num_1 = num_1 / num_2; } for (int i = 0; i < store.size(); i++) { cout << store[i]; if (i != store.size() - 1) { cout << " "; } } printf("\n"); } else { cout << "Boring!\n"; store.clear(); } } return 0; } ```