记录详情

Compile Error

foo.cc: In function 'void init()':
foo.cc:5:32: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int n,s,a[10000],x=1,y=n,mid=x+y>>1;
                               ~^~
foo.cc:5:27: warning: unused variable 'mid' [-Wunused-variable]
  int n,s,a[10000],x=1,y=n,mid=x+y>>1;
                           ^~~
foo.cc: In function 'void qwe()':
foo.cc:13:12: error: 'n' was not declared in this scope
  int x=1,y=n,mid=x+y>>1;
            ^
foo.cc:16:9: error: 'a' was not declared in this scope
      if(a[x]==s)
         ^
foo.cc:16:15: error: 's' was not declared in this scope
      if(a[x]==s)
               ^
foo.cc:21:9: error: 'a' was not declared in this scope
      if(a[mid]==s)
         ^
foo.cc:21:11: error: 'mid' was not declared in this scope
      if(a[mid]==s)
           ^~~
foo.cc:21:17: error: 's' was not declared in this scope
      if(a[mid]==s)
                 ^
foo.cc:31:1: error: expected initializer before '}' token
 }
 ^
foo.cc: At global scope:
foo.cc:32:12: error: expected constructor, destructor, or type conversion before ';' token
      init();
            ^
foo.cc:33:7: error: expected constructor, destructor, or type conversion before ';' token
  qwe();
       ^
foo.cc:34:5: error: expected unqualified-id before 'if'
     if(a[mid]!=s) cout<<-1;
     ^~
foo.cc:35:5: error: expected unqualified-id before 'return'
     return 0;
     ^~~~~~
foo.cc:36:1: error: expected declaration before '}' token
 }
 ^

自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)

信息

递交者
类型
递交
题目
二分查找(binary)
题目数据
下载
语言
C++
递交时间
2019-07-03 11:36:17
评测时间
2020-07-10 15:27:12
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes