#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t, n;
int i, j;
cin >> t;
for (i = 0; i < t; i++)
{
stack<long long> m;
string s;
cin >> n;
for (j = 0; j < n; j++)
{
cin >> s;
if (s == "push")
{
long long temp;
cin >> temp;
m.push(temp);
}
else if (s == "query")
{
if (s.empty())
{
cout << "Auguei!" << endl;
}
else
{
cout << m.top() << endl;
}
}
else if (s == "pop")
{
if (m.empty())
{
cout << "Empty" << endl;
}
else m.pop();
}
else if (s == "size")
{
cout << m.size() << endl;
}
}
}
return 0;
}
这是我的代码,我尝试看了题解去改,但还是RE了,有人能帮助我吗?