#include<bits/stdc++.h>
#include<stack>
using namespace std;
int main() {
stack <long long> s;
unsigned long long t , n , x;
cin >> t;
string a;
while ( t-- ) {
cin >> n;
for ( long long 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!\n" ;
}
else if (a == "query" ) {
if( !s.empty() )
cout << s.top() << endl ;
else
cout << "Anguei!\n" ;
}
else {
cout << s.size() << endl ;
}
}while(!s.empty()){
s.pop();
}
}
return 0;
}
我就搞不懂了
为什么全是WA?????????(╬▔皿▔)╯