C++-快速排序[STL实现][优先队列]

 1 #include <queue>
 2 #include <iostream>
 3 using namespace std;
 4 priority_queue<int>q;
 5 int main(){
 6     for(int a;cin>>a;q.push(-a))
 7         if(a==0){
 8             for(;!q.empty();q.pop())cout<<-q.top()<<" ";
 9             return 0;
10         }
11 } 

题源:蓝桥杯

猜你喜欢

转载自www.cnblogs.com/JasonCow/p/12448242.html