【队列】

先进先出

#include<queue>
#include<cstdio>
using namespace std;
int main()
{
    queue<int> q;
    q.push(1);//{}->{1}
    q.push(2);//{1}->{1.2}
    printf("%d\n",q.front());//1
    q.pop();//从栈顶移除{1,2,3}->{2,3}
    printf("%d\n",q.front());//2
    return 0;
} 
View Code

 

posted @ 2017-09-06 22:47  LizLiz  阅读(81)  评论(0)    收藏  举报