Pārlūkot izejas kodu

Insert a maximum int

DricomDragon 5 gadi atpakaļ
vecāks
revīzija
1c2d9a1896
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      containers/main.cpp

+ 2 - 0
containers/main.cpp

@@ -2,6 +2,7 @@
 #include <queue> // priority_queue
 #include <queue> // priority_queue
 #include <utility> // pair
 #include <utility> // pair
 #include <functional> // greater
 #include <functional> // greater
+#include <limits>
 
 
 using namespace std;
 using namespace std;
 
 
@@ -18,6 +19,7 @@ int main() {
 	pqInt.push(0);
 	pqInt.push(0);
 	pqInt.push(42);
 	pqInt.push(42);
 	pqInt.push(3);
 	pqInt.push(3);
+	pqInt.push(numeric_limits<int>::max());
 
 
 	while (!pqInt.empty()) {
 	while (!pqInt.empty()) {
 		cout << pqInt.top() << " > ";
 		cout << pqInt.top() << " > ";