Compile Error

foo.cc: In function 'int main()':
foo.cc:37:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   long long mid=l+r>>1;
                 ~^~
foo.cc:44:4: error: 'ans' was not declared in this scope
    ans=mid;
    ^~~
foo.cc:44:4: note: suggested alternative: 'abs'
    ans=mid;
    ^~~
    abs
foo.cc:49:8: error: 'ans' was not declared in this scope
  cout<<ans;
        ^~~
foo.cc:49:8: note: suggested alternative: 'abs'
  cout<<ans;
        ^~~
        abs
foo.cc:29:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a[i]);
   ~~~~~^~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
题目
「一本通 1.2 练习 1」数列分段 II
语言
C++
递交时间
2021-03-13 19:35:54
评测时间
2021-03-13 19:35:54
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes