程序
#include<bits/stdc++.h>
using namespace std;
stack<unsigned long long> a;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int n;
cin>>n;
for(int j=0;j<n;j++)
{
string b;
cin>>b;
if(b=="push")
{
unsigned long long c;
cin>>c;
a.push(c);
}
if(b=="pop")
{
if(!a.empty())
{
a.pop();
}
else
{
cout<<"Empty"<<endl;
}
}
if(b=="query")
{
if(!a.empty())
{
cout<<a.top()<<endl;
}
else
{
cout<<"Anguei!"<<endl;
}
}
if(b=="size")
{
cout<<a.size()<<endl;
}
while(!a.empty())
{
a.pop();
}
}
}
return 0;
}