Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by Julio Tentor <jtentor@fi.unju.edu.ar>
- //
- #include <iostream>
- #include <stack>
- int main() {
- std::cout << "Demo de Stack - Pila" << std::endl;
- std::stack<char> miPila = std::stack<char>();
- miPila.push('a');
- miPila.push('b');
- miPila.push('c');
- while (!miPila.empty()) {
- std::cout << miPila.top() << std::endl;
- miPila.pop();
- }
- try {
- miPila.pop();
- }
- catch (std::exception const & e) {
- std::cout << e.what() << std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement