Advertisement
Josif_tepe

Untitled

Aug 17th, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <queue>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main()
  8. {
  9.     priority_queue<int> pq;
  10.     pq.push(3);
  11.     pq.push(2);
  12.     pq.push(1);
  13.     pq.push(4);
  14.     pq.push(5);
  15.    
  16.     while(!pq.empty()) {
  17.         cout << pq.top() << endl;
  18.         pq.pop();
  19.        
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement