Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:5:17: error: 'INT_MIN' was not declared in this scope
    5 |         int max=INT_MIN,maxbh,min=INT_MAX,minbh,cnt=1;
      |                 ^~~~~~~
/in/foo.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; did you forget to '#include <climits>'?
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
/in/foo.cc:11:25: error: 'maxbh' was not declared in this scope; did you mean 'max'?
   11 |                         maxbh=cnt;
      |                         ^~~~~
      |                         max
/in/foo.cc:11:31: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |                         maxbh=cnt;
      |                               ^~~
      |                               int
/in/foo.cc:13:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   13 |                 if(a<min){
      |                    ~^~~~
/in/foo.cc:14:29: error: overloaded function with no contextual type information
   14 |                         min=a;
      |                             ^
/in/foo.cc:15:25: error: 'minbh' was not declared in this scope
   15 |                         minbh=cnt;
      |                         ^~~~~
/in/foo.cc:15:31: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |                         minbh=cnt;
      |                               ^~~
      |                               int
/in/foo.cc:17:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |                 cnt++;
      |                 ^~~
      |                 int
/in/foo.cc:19:15: error: 'maxbh' was not declared in this scope; did you mean 'max'?
   19 |         cout<<maxbh<<" "<<max<<endl;
      |               ^~~~~
      |               max
/in/foo.cc:20:15: error: 'minbh' was not declared in this scope
   20 |         cout<<minbh<<" "<<min<<endl;
      |               ^~~~~

信息

递交者
类型
递交
题目
P2568 找最大数和最小数
比赛
2026.2.8中级班练习
语言
C++
递交时间
2026-02-08 16:24:21
评测时间
2026-02-08 16:24:21
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes