#include using namespace std; void spaces(int n) { for (int i = 0; i < n; i += 1) cout << " "; } struct tracer { int param; static int depth; tracer(int p) { param = p; depth += 1; spaces(depth); cout << "function called with parameter " << param << "\n"; } ~tracer() { spaces(depth); cout << "function with parameter " << param << " exitted\n"; depth -= 1; } }; int tracer::depth = 0; void f(int x) { tracer o(x); int q = x / 10, r = x % 10; if (q > 0) f(q); cout << r << "\n"; if (q > 0) f(q); } int main() { f(47282); cout << "\n"; }