Compile Error

foo.cc: In function 'int main()':
foo.cc:5:24: error: expected identifier before numeric constant
    5 |  int i,ls,score=0,n,x=[100];
      |                        ^~~
foo.cc: In lambda function:
foo.cc:5:28: error: expected '{' before ';' token
    5 |  int i,ls,score=0,n,x=[100];
      |                            ^
foo.cc: In function 'int main()':
foo.cc:5:28: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
foo.cc:5:23: note: candidate is: 'main()::<lambda()>::operator void (*)()() const' <near match>
    5 |  int i,ls,score=0,n,x=[100];
      |                       ^
foo.cc:5:23: note:   no known conversion from 'void (*)()' to 'int'
foo.cc:8:6: error: invalid types 'int[int]' for array subscript
    8 |   x[i]=(x[i-1]*3703+1047)%n+1;
      |      ^
foo.cc:8:14: error: invalid types 'int[int]' for array subscript
    8 |   x[i]=(x[i-1]*3703+1047)%n+1;
      |              ^
foo.cc:10:10: error: invalid types 'int[int]' for array subscript
   10 |  if(x[i-1]==x[i])
      |          ^
foo.cc:10:16: error: invalid types 'int[int]' for array subscript
   10 |  if(x[i-1]==x[i])
      |                ^
foo.cc:20:9: error: 'a' was not declared in this scope
   20 |   ls=3; a[x[i]]+=ls;
      |         ^
foo.cc:20:14: error: invalid types 'int[int]' for array subscript
   20 |   ls=3; a[x[i]]+=ls;
      |              ^
foo.cc:22:6: error: 'a' was not declared in this scope
   22 |  for(a[i]>score)
      |      ^
foo.cc:27:2: error: expected primary-expression before 'return'
   27 |  return 0;
      |  ^~~~~~
foo.cc:26:14: error: expected ')' before 'return'
   26 |  cout<<score;
      |              ^
      |              )
   27 |  return 0;
      |  ~~~~~~       
foo.cc:22:5: note: to match this '('
   22 |  for(a[i]>score)
      |     ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1064 分数计数
语言
C++
递交时间
2022-05-09 16:36:24
评测时间
2022-05-09 16:36:24
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes