Guest User

Untitled

a guest
Mar 5th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include <iostream>
  5. #include <vector>
  6. #include <stack>
  7.  
  8. using namespace std;
  9.  
  10.  
  11. int main ()
  12. {
  13. vector<int> numbers{4, 15, 8, 7, 9, 31};
  14. stack <int> s;
  15.  
  16. for (auto i : numbers){
  17. s.push(i);
  18. }
  19.  
  20.  
  21. cout << "\ns.size() : " << s.size();
  22. cout << "\ns.top() : " << s.top();
  23.  
  24.  
  25. cout << "\ns.pop() : ";
  26. cout << &s.top();
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment