#include<iostream>
#include<queue>
using namespace std;
int main(){
queue<int> q;
for(int i=1;i<3;i++)q.push(i);
for(int i=3;i>0;i--)q.push(i);
cout<<q.front()<<" "<<q.back()<<endl;
cout<<endl<<"pop"<<endl;
cout<<q.front()<<" "<<q.back()<<endl;
if(q.empty())cout<<"empty 1"<<endl;
while(!q.empty())q.pop();
if(q.empty())cout<<"empty 2"<<endl;
return 0;
}
queue
最新推荐文章于 2024-09-16 07:00:00 发布