B3614 样例过了,交上去0分
#include<bits/stdc++.h>
using namespace std;
stack<long long> s;
int main()
{
long long t,n,x,i;
string a;
cin>>t;
while(!s.empty())
s.pop();
while(t--)
{
cin>>n;
while(!s.empty())
s.pop();
for(i=1;i<=n;i++)
{
cin>>a;
if(a=="push")
{
cin>>x;
s.push(x);
}
else if(a=="pop")
{
if(!s.empty())
s.pop();
else
cout<<"Empty"<<endl;
}
else if(a=="query")
{
if(!s.empty())
cout<<s.top()<<endl;
else
cout<<"Anguei!"<<endl;
}
else
cout<<s.size()<<endl;
}
}
return 0;
}