容器queue

//容器queue于stack相似,内部含有stack,本质算为容器的适配器
#include<iostream>
#include<queue>
using namespace std;
int main(){
    queue<int>q;
    q.push(1);
    q.push(2);
    cout<<q.front()<<endl;
    cout<<q.size()<<endl;
    q.pop();
    cout<<q.front()<<endl;
    return 0;
} 

猜你喜欢

转载自www.cnblogs.com/zmachine/p/12289823.html
今日推荐