Compile Error

foo.cc: In function ‘int main()’:
foo.cc:24:20: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   24 |                 if(int j=i+1;j<n;j++)
      |                    ^~~
foo.cc:24:33: error: expected ‘)’ before ‘;’ token
   24 |                 if(int j=i+1;j<n;j++)
      |                   ~             ^
      |                                 )
foo.cc:24:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   24 |                 if(int j=i+1;j<n;j++)
      |                 ^~
foo.cc:24:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   24 |                 if(int j=i+1;j<n;j++)
      |                                  ^
foo.cc:24:34: error: ‘j’ was not declared in this scope
foo.cc:21:14: warning: unused variable ‘st’ [-Wunused-variable]
   21 |         bool st=0;
      |              ^~

信息

递交者
类型
递交
题目
P3082 兑换礼品 pta202107T4
语言
C++
递交时间
2026-10-16 15:12:51
评测时间
2026-10-16 15:12:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes