Compile Error

foo.cc: In function ‘int main()’:
foo.cc:20:28: error: invalid types ‘bool[int]’ for array subscript
   20 |                         ans[i]=1;
      |                            ^
foo.cc:21:25: error: invalid types ‘bool[int]’ for array subscript
   21 |                 else ans[i]=0;
      |                         ^
foo.cc:23:13: error: expected primary-expression before ‘)’ token
   23 |         for()
      |             ^
foo.cc:25:1: error: expected primary-expression before ‘}’ token
   25 | }
      | ^
foo.cc:24:18: error: expected ‘;’ before ‘}’ token
   24 |         return 0;
      |                  ^
      |                  ;
   25 | }
      | ~                 
foo.cc:25:1: error: expected primary-expression before ‘}’ token
   25 | }
      | ^
foo.cc:24:18: error: expected ‘)’ before ‘}’ token
   24 |         return 0;
      |                  ^
      |                  )
   25 | }
      | ~                 
foo.cc:23:12: note: to match this ‘(’
   23 |         for()
      |            ^
foo.cc:25:1: error: expected primary-expression before ‘}’ token
   25 | }
      | ^

信息

递交者
类型
递交
题目
P1002 摘葡萄
语言
C++
递交时间
2024-10-04 10:31:32
评测时间
2024-10-04 10:31:32
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes