Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define ll long long
- #define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
- #define N ((int)1e6 + 9)
- #define endl "\n"
- using namespace std;
- /*fast io
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- */
- /// stack
- int main()
- {
- // fastio;
- int n;
- cin>>n;
- stack < int > stt;
- while(n > 0){
- n--;
- int a;
- cin>>a;
- stt.push(a);
- }
- while(stt.empty() == 0){
- int a = stt.top();
- stt.pop();
- cout<<a<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement