fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6. priority_queue <int> pq;
  7. int arr[]={1,2,3,4,5};
  8. for(int i=0;i<5;i++)
  9. pq.push(arr[i]);
  10.  
  11. while(!pq.empty())
  12. {
  13. printf("%d,\n",pq.top());
  14. pq.pop();
  15. }
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
5,
4,
3,
2,
1,