#include<iostream> #include<stack> using namespace std; int main(){ stack<int>mys; mys.push(5); mys.push(3); mys.push(8); mys.push(4); mys.push(1); mys.push(2); mys.push(7); while(!mys.empty()){ cout<<mys.top()<<" "; mys.pop(); } cout<<endl; return 0; }