哪有错滴?
错两个,MLE一个,0分
/*
1、B3614 【模板】栈
*/
#include<bits/stdc++.h>
using namespace std;
stack <int> st;
int main(){
int t,n,x;
string s;
cin>>t;
for(int i=1;i<=t;i++){
cin>>n;
while(n--){
cin>>s;
if(s=="push"){
cin>>x;
st.push(x);
}
else if(s=="pop"){
if(!st.empty())st.pop();
else cout<<"Empty";
}
else if(s=="query"){
if(!st.empty())cout<<st.top()<<endl;
else cout<<"Anguei!"<<endl;
}
else if(s=="size")cout<<st.size()<<endl;
}
}
return 0;
}