Posted on

Description

Submission

#include <cmath>
#include <cstdio>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */
    int q; cin >> q;

    queue<int> Q;
    while(q--) {
        int type; cin >> type;
        if(type == 1) {
            int x; cin >> x;
            Q.push(x);
        }

        if(type == 2) {
            Q.pop();
        }

        if(type == 3) {
            cout << Q.front() << endl;
        }
    }
    return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *