#include<bits/stdc++.h>
using namespace std;
stack<unsigned long long>st;
int T,n,k;
int main()
{
cin>>T;
string str1;
while(T--)
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>str1;
if(str1=="push") cin>>k,st.push(k);
if(str1=="query")
if(st.size()!=0) cout<<st.top()<<endl;
else cout<<"Anguei!"<<endl;
if(str1=="size") cout<<st.size()<<endl;
if(str1=="pop")
if(st.size()==0) cout<<"Empty"<<endl;
else st.pop();
}
while(!st.empty()) st.pop();
}
return 0;
}
帮了我的会给关注(你没有被我关注过)哦!
QwQ