#include #include #include main () { stack foo; foo.push(42); foo.push(4); foo.push(24); foo.push(15); foo.push(51); foo.push(5); cout << "Stack top: " << foo.top() << endl; int n = 1; do { cout << "Stack top after " << n << " pops: " << foo.top() << endl; foo.pop(); n++; } while (!foo.empty()) ; }