#include using namespace std; string digit[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; string f(int N) { int R = N % 10, Q = N / 10; string s = ""; if (Q > 0) s = f(Q); return s + digit[R] + " "; } int main() { while (true) { int x; cout << "? "; cin >> x; cout << "\n"; string result = f(x); cout << result << "\n\n"; } }