fork download
  1. #include <iostream>
  2. #include <stack>
  3. using namespace std;
  4.  
  5. void* operator new(size_t t) {
  6. cout << "ALOCADO " << t << '\n';
  7. return malloc(t);
  8. }
  9.  
  10. int main() {
  11. // your code goes here
  12. std::stack<int> k;
  13. k.push(1);
  14. while(k.size()) {
  15. cout << k.top() << '\n';
  16. k.pop();
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4464KB
stdin
Standard input is empty
stdout
ALOCADO 64
ALOCADO 512
1