#include "library.h" int digits_in(const int N) { if (N < 10) return 1; return 1 + digits_in(N / 10); } int ten_to_the_power_of(const int P) { if (P < 0) return 0; if (P == 0) return 1; return 10 * ten_to_the_power_of(P - 1); } void print_all_digits(const int N, const int P) { if (P > 0) { const int digit = N/P; print(" "); print(digit); const int remainder = N - P*digit; print_all_digits(remainder, P/10); } } void print_digits_forwards(const int N) { const int ND = digits_in(N); const int P = ten_to_the_power_of(ND - 1); const int digit = N/P; print(digit); const int remainder = N - P*digit; print_all_digits(remainder, P/10); } void test() { const int x = read_int(); print_digits_forwards(x); new_line(); test(); } void main() { test(); }