C++
#include<iostream>
#include<queue>
using namespace std;
int main()
{
priority_queue<int,vector<int>,greater<int>> q;
int n;
int t;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>t;
q.push(t);
}
while(!q.empty())
{
cout<<q.top()<<" ";
q.pop();
}
cout<<endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发