0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 18:12:00 +00:00
OI-codes/AcWing/829/829.cpp

26 lines
456 B
C++

#include <bits/stdc++.h>
using namespace std;
int m, x;
string op;
queue<int> q;
int main() {
cin >> m;
while (m--) {
cin >> op;
if (op == "push") {
cin >> x;
q.push(x);
} else if (op == "pop") {
q.pop();
} else if (op == "empty") {
cout << (q.empty() ? "YES" : "NO") << endl;
} else {
cout << q.front() << endl;
}
}
return 0;
}