//queue 一端插入 另一端删除
//不能遍历(不提供迭代器) 不支持随机访问
#include <queue>
#include <iostream>
using namespace std;



void test01() {
    queue<int> q1;
    q1.push(10);//尾部插入
    q1.push(20);
    q1.push(30);
    q1.pop();//删除队头
    cout << q1.back();//返回队尾元素
    cout << q1.front();//返回队头元素
    cout << q1.size();       
    if (q1.empty()) {}


}











int main() {

}

 

posted on 2018-12-26 17:19  likeghee  阅读(119)  评论(0编辑  收藏  举报