#include <iostream>
#include<queue>
#include <functional>
#include<vector>
using namespace std;
struct node
{
int x;
friend bool operator>(node n1,node n2)
{
return n1.x<n2.x;
}
};
int main()
{
int n;
node m;
while(cin>>n)
{
priority_queue<node>q;//最大值优先
while(n--)
{
cin>>m.x;
q.push(m);
}
while(!q.empty())
{
cout<<q.top().x<<" ";
q.pop();
}
}
return 0;
}
最大值优先
最新推荐文章于 2023-05-27 12:07:40 发布