#include <iostream>
#include <stack>
using namespace std;
int main(){
stack<int> s;
int n,value;
cout<<“enter number of elements:”;
cin>>n;
cout<<“enter “<<n<<” elements:”<<endl;
for (int i=0;i<n;i++){
cin>>value;
s.push(value);
}
cout<<endl<<“stack elements (from top to bottom):”<<endl;
while (!s.empty()){
cout<<s.top()<<” “;
s.pop();
}
cout<<endl;
return 0;
}