#include <iostream>
using namespace std;
#include <queue>
#define N 5
int main() {
int arr[5] = { 2,4,6,23,5 };
priority_queue<int> que;
for (int i = 0; i < N; i++)
{
que.push(arr[i]);
cout << "现在优先级最高的队列元素: " <<que.top() << endl;
}
cout << "que size: " << que.size() << endl;
for (int i = 0; i < N; i++)
{
cout << "准备出队" << que.top() << endl;
que.pop();
}
cout << "que size: " << que.size() << endl;
system("pause");
return 0;
}
自动排序优先级大小