C++ queue和priority_queue用法

#include <iostream>
#include <string>
#include "TestFunction.h"
#include <queue>
#include <gtest/gtest.h>
using namespace std;
//using ::testing::InitGoogleTest;
using namespace testing;

#pragma comment(lib, "gtestd.lib")


void main(int argc, char **argv)
{

/*priority_queue<int> pqe;
pqe.push(10);
pqe.push(15);
pqe.push(18);
pqe.push(56);
pqe.push(8);
int size = pqe.size();
for (int i = 0; i < size; ++i)
{
int tem = pqe.top();
pqe.pop();
cout << tem << " " ;
}*/

queue<int> que;
que.push(10);
que.push(15);
que.push(18);
que.push(56);
que.push(8);


for (int i = 0; i < size; ++i)
{
int tem;
tem = que.front();
cout << tem << " ";
que.pop();

}
int wait;
cin >> wait;
}

posted @ 2013-07-06 12:41  Predator  阅读(224)  评论(0编辑  收藏  举报