0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-16 20:05:26 +00:00
Baoshuo Ren 2021-08-27 19:26:18 +08:00 committed by Baoshuo Ren
parent 01ab18dd50
commit 1ef3672428
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

25
AcWing/829/829.cpp Normal file
View File

@ -0,0 +1,25 @@
#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;
}