Advertisement
Josif_tepe

Untitled

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