main.cpp 404 B

123456789101112131415161718192021222324252627
  1. #include <iostream>
  2. #include <queue>
  3. using namespace std;
  4. int main() {
  5. cout << "Hello containers !" << endl;
  6. cout << "# Priority queue" << endl;
  7. cout << "## With integers" << endl;
  8. priority_queue<int> pqInt;
  9. pqInt.push(5);
  10. pqInt.push(2);
  11. pqInt.push(0);
  12. pqInt.push(42);
  13. pqInt.push(3);
  14. while (!pqInt.empty()) {
  15. cout << pqInt.top() << " > ";
  16. pqInt.pop();
  17. }
  18. cout << endl;
  19. return 0;
  20. }