我这有什么问题吗??!! 有个测试点明明输出和答案一样, 它还WA!!!
#include <iostream>
using namespace std;
const int N = 100010;
int QuickStack[N];
int head;
void push(int x){ QuickStack[++ head] = x; }
void pop(){ head --; }
bool empty(){ return head == 0; }
int query(){ return QuickStack[head]; }
int main()
{
ios :: sync_with_stdio(false),
cin.tie(0),
cout.tie(0);
int n;
cin >> n;
while(n --){
string que;
int x;
cin >> que;
if(que == "push") cin >> x, push(x);
else if(que == "pop") pop();
else if(que == "query") cout << query() << endl;
else cout << (empty() ? "Yes" : "No") << endl;
}
return 0;
}
哥们输出是大写的啊
谢谢大佬!!
“YES” “NO” (●’◡’●)
谢谢大佬