stack2.cpp

We use cookies. Read the Privacy and Cookie Policy

stack2.cpp

#include ‹iostream.h›

#include ‹stl.h›

int main() {

 stack‹list‹int› › s;

 s.push(42);

 s.push(101);

 s.push(69);

 while (!s.empty()) {

  cout ‹‹ s.top() ‹‹ endl;

  s.pop();

 }

 return 0;

}