소스 검색

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() << " > ";