记录详情

Compile Error

/in/foo.cc: In function 'int finmaxneg(std::vector<int>&)':
/in/foo.cc:13:18: error: 'INT_MAX' was not declared in this scope
   13 |     int maxneg =-INT_MAX;
      |                  ^~~~~~~
/in/foo.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include<vector>
  +++ |+#include <climits>
    3 | using namespace std;
/in/foo.cc:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for (int j = 0; j < arr.size(); j++) {
      |                     ~~^~~~~~~~~~~~
/in/foo.cc: In function 'int findminpos(std::vector<int>&)':
/in/foo.cc:23:15: error: 'INT_MAX' was not declared in this scope
   23 |     int val = INT_MAX;
      |               ^~~~~~~
/in/foo.cc:23:15: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
/in/foo.cc:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for (int j = 0; j < arr.size(); j++) {
      |                     ~~^~~~~~~~~~~~

信息

递交者
类型
递交
题目
A9-3 数组中最大的负数
比赛
2025年暑期编程训练营之二
语言
C++
递交时间
2025-07-05 09:04:16
评测时间
2025-07-05 09:04:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes