浏览代码

Insert a maximum int

DricomDragon 5 年之前
父节点
当前提交
1c2d9a1896
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      containers/main.cpp

+ 2 - 0
containers/main.cpp

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