que遍历
#include<iostream>
#include<queue>
using namespace std;
int main(int argc, char* argv[]) {
queue<int> myqueue;
myqueue.push(1);
myqueue.push(2);
myqueue.push(3);
int myqueue_size = myqueue.size();
for(int i = 0; i < myqueue_size; i++) { //myqueue_size 必须是固定值
cout << myqueue.front() << endl;
myqueue.push(myqueue.front());
myqueue.pop();
}
}
int main(int argc, char** argv) {
// priority_queue<int> que;
queue<int> que;
que.push(2);
que.push(4);
que.push(5);
while (!que.empty()){
cout<<que.front()<<endl;
que.pop();
}
return 0;
}