123456789101112131415161718192021222324252627 |
- #include <iostream>
- #include <queue>
- using namespace std;
- int main() {
- cout << "Hello containers !" << endl;
- cout << "# Priority queue" << endl;
- cout << "## With integers" << endl;
- priority_queue<int> pqInt;
- pqInt.push(5);
- pqInt.push(2);
- pqInt.push(0);
- pqInt.push(42);
- pqInt.push(3);
- while (!pqInt.empty()) {
- cout << pqInt.top() << " > ";
- pqInt.pop();
- }
- cout << endl;
- return 0;
- }
|