记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:6:26: error: expected ‘;’ before ‘int’
    6 |         std::cin>>a>>b>>c
      |                          ^
      |                          ;
    7 |         int max=a;
      |         ~~~               
foo.cc:9:15: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
    9 |         if (b>max){
      |               ^~~
      |               std::max
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/string:51,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/bits/locale_classes.h:40,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/bits/ios_base.h:41,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/ios:44,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/ostream:40,
                 from iostream:41:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note: ‘std::max’ declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
foo.cc:12:15: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   12 |         if (c>max){
      |               ^~~
      |               std::max
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note: ‘std::max’ declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
foo.cc:15:25: error: ‘c)’ was not declared in this scope
   15 |         if ((a<=b && a>=c)|| (a>=b && a<=c)){
      |                         ^~~
foo.cc:15:46: error: expected ‘)’ before ‘{’ token
   15 |         if ((a<=b && a>=c)|| (a>=b && a<=c)){
      |            ~                                 ^
      |                                              )
foo.cc:23:26: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   23 |     std::cout<<mid<<" "<<max<<std::endl;
      |                          ^~~
      |                          std::max
/nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:303:5: note: ‘std::max’ declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
foo.cc:25:2: error: expected ‘}’ at end of input
   25 | }
      |  ^
foo.cc:4:1: note: to match this ‘{’
    4 | {
      | ^

信息

递交者
类型
递交
题目
A1-2 分支结构练习:三数的特征值
比赛
南师大(含泰州学院)2024年新生赛(第一场)
语言
C++
递交时间
2024-08-17 10:53:40
评测时间
2024-08-17 10:53:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes