fork download
  1. #include <iostream>
  2. #include <stack>
  3. using namespace std;
  4. //Ejemplo 2
  5. int main() {
  6. stack <char> pila1;
  7. char i;
  8. for(i='a'; i<='z'; i++) pila1.push(i);
  9. cout << pila1.size() << endl;
  10. cout << pila1.top() << endl;
  11. cout << pila1.empty() << endl;
  12. while(!pila1.empty()){
  13. cout << pila1.top() << " ";
  14. pila1.pop();
  15. }
  16. cout << endl << pila1.empty();
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
26
z
0
z  y  x  w  v  u  t  s  r  q  p  o  n  m  l  k  j  i  h  g  f  e  d  c  b  a  
1