#include<iostream>
#include<string>
#include<stack>
using namespace std;
stack<unsigned long long > st;
int main(){
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
cin>>T;
while(T--){
int n;
cin>>n;
while(n--){
string od;
unsigned long long x;
cin>>od;
if(od=="push"){
cin>>x;
st.push(x);
}
if(od=="pop"){
if(!st.empty())
st.pop();
else
cout<<"Empty"<<'\n';
}
if(od=="query"){
if(!st.empty())
cout<<st.top()<<'\n';
else
cout<<"Anguei!"<<'\n';
}
if(od=="size")
cout<<st.size()<<'\n';
}
}
return 0;
}
模板栈 总是wa一点 66pts 求调