记录详情

Compile Error

foo.cc: In function 'void BubbleSort(int*, int, int)':
foo.cc:23:7: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17'
   23 |    if(a[j-1]>a[j]
      |       ^
foo.cc:23:18: error: expected ';' before '{' token
   23 |    if(a[j-1]>a[j]
      |                  ^
      |                  ;
   24 |    {
      |    ~              
foo.cc:23:13: warning: statement has no effect [-Wunused-value]
   23 |    if(a[j-1]>a[j]
      |       ~~~~~~^~~~~
foo.cc:30:3: error: expected primary-expression before 'if'
   30 |   if(sucess==true)
      |   ^~
foo.cc:29:8: error: expected ')' before 'if'
   29 |       }
      |        ^
      |        )
   30 |   if(sucess==true)
      |   ~~    
foo.cc:23:6: note: to match this '('
   23 |    if(a[j-1]>a[j]
      |      ^
foo.cc:21:8: warning: unused variable 'sucess' [-Wunused-variable]
   21 |   bool sucess=true;
      |        ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
DS8-1 冒泡排序的第k趟
语言
C++
递交时间
2021-12-20 15:34:25
评测时间
2021-12-20 15:34:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes