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