queue

#include <queue>
#include <iostream>
#include <cstdio>
#include <cctype>
using namespace std;
typedef long long ll;
queue < ll > q;
inline ll read () {
    ll x=0,f=1;
    char ch=getchar();
    while(!isdigit(ch)) {
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(isdigit(ch)) {
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}
int n;
signed main() {
    n=read();
    for(register int i=1; i<=n; i++) q.push(read());
    while(!q.empty()){
        cout<<q.front()<<' ';
        q.pop();
    }
    return 0;
//q.empty() 判断队列是否是空的
//q.clear() 清空队列
//q.push(x) 把x放到队尾
//q.front() q的第一个元素
//q.pop() q的第一个元素出队
//q.size() q的元素个数
}

 

posted @ 2019-01-31 12:06  Isaunoya  阅读(180)  评论(0编辑  收藏  举报
TOP