我真的不知道为什么33分了?求助各位大神!!!
#include<bits/stdc++.h>
using namespace std;
std::stack<unsigned long long> m;
int unsigned long long T,n,x;
string b;
void push(int l)
{
m.push(l);
}
void pop()
{
if(m.empty())
{
cout<<"Empty"<<endl;
return;
}
m.pop();
}
void query()
{
if(m.empty())
{
cout<<"Anguei!"<<endl;
return;
}
cout<<m.top()<<endl;
}
void size()
{
cout<<m.size()<<endl;
}
int main()
{
cin>>T;
for(int i=1;i<=T;i++)
{
cin>>n;
for(int j=1;j<=n;j++)
{
cin>>b;
if(b=="push")
{
cin>>x;
push(x);
}
if(b=="query")
{
query();
}
if(b=="pop")
{
pop();
}
if(b=="size")
{
size();
}
}
}
}