Josif_tepe

Untitled

Jan 21st, 2026
22
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 <vector>
  3. #include <queue>
  4. using namespace std;
  5.  
  6. int main() {
  7.    
  8.     priority_queue<int> pq;
  9.    
  10.     pq.push(3);
  11.     pq.push(1);
  12.     pq.push(2);
  13.     pq.push(4);
  14.     pq.push(6);
  15.    
  16.     while(!pq.empty()) {
  17.         cout << pq.top() << " ";
  18.         pq.pop();
  19.     }
  20.    
  21.    
  22.    
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment