望诸位大佬救救我这个蒟蒻吧!
#include <bits/stdc++.h>
using namespace std;
stack <int> s;
int a, b, e;
string c;
int main() {
cin >> a;
for (int i = 1; i <= a; i++) {
cin >> b;
for (int j = 1; j <= b; j++) {
cin >> c;
if (c == "push") {
cin >> e;
s.push(e);
}
if (c == "pop") {
if (s.empty() == 0) {
s.pop();
} else {
cout << "Empty" << "\n";
}
}
if (c == "query") {
if (s.empty() == 0) {
cout << s.top() << "\n";
} else {
cout << "Anguei!" << "\n";
}
}
if (c == "size") {
cout << s.size() << "\n";
}
}
}
return 0;
}