1: //file :4pqueue-test.cpp
2: #include <queue>
3: #include <iostream>
4: #include <algorithm>
5: using namespace std;
6:
7: int main()
8: {
9: //test priority queue...
10: int ia[9] = {0,1,2,3,4,8,9,3,5};
11: priority_queue<int> ipq(ia,ia+9);
12: cout << "size=" << ipq.size() << endl;
13:
14: for (unsigned i=0; i<ipq.size();i++)
15: {
16: cout << ipq.top() << ' ';
17: }
18:
19: cout << endl;
20:
21: while (!ipq.empty())
22: {
23: cout << ipq.top() << ' ';
24: ipq.pop();
25: }
26: cout << endl;
27: return 0;
28: }