队列

 1 #include <cstdio>
 2 #include <iostream>
 3 #include <queue>
 4 using namespace std;
 5 int main()
 6 {
 7     queue<int> q;
 8     q.push(1);//1
 9     q.push(2);//1,2
10     q.push(3);//1,2,3
11     cout<<q.front()<<endl;//1
12     q.pop();//2,3
13     cout<<q.front()<<endl;//2
14     q.pop();//3
15     cout<<q.front()<<endl;//3
16     q.pop();//
17     return 0;
18 }
View Code
posted @ 2018-12-30 18:26  wydxry  阅读(274)  评论(0编辑  收藏  举报
Live2D