#include"iostream" #include"algorithm" #include"queue" using namespace std; const int maxn=5e4+5; struct AAA { int t; bool operator<(const AAA &a)const { return t<a.t; } }; int main() { priority_queue<AAA>que; AAA a[10]={1,2,3,6,5,4}; for(int i=0;i<6;i++)que.push(a[i]); while(!que.empty()) { cout<<que.top().t<<" "; que.pop(); } cout<<"\n"; sort(a,a+6); for(int i=0;i<6;i++)cout<<a[i].t<<" "; }