Compile Error

/in/foo.cc:4:15: error: 'int y1' redeclared as different kind of entity
    4 | int n1=0,n2=0,y1=0,y2=0,y3=0,y4=0,y5=0,y6=0,y7=0,y8=0,y9=0,y0=0;
      |               ^~
In file included from /usr/include/features.h:489,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:655,
                 from /usr/include/c++/12/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:33,
                 from /in/foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:224:1: note: previous declaration 'double y1(double)'
  224 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
/in/foo.cc:4:60: error: 'int y0' redeclared as different kind of entity
    4 | int n1=0,n2=0,y1=0,y2=0,y3=0,y4=0,y5=0,y6=0,y7=0,y8=0,y9=0,y0=0;
      |                                                            ^~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:223:1: note: previous declaration 'double y0(double)'
  223 | __MATHCALL (y0,, (_Mdouble_));
      | ^~~~~~~~~~
/in/foo.cc: In function 'void Unique(int*, int)':
/in/foo.cc:9:7: error: assignment of function 'double y1(double)'
    9 |     y1=0,y2=0,y3=0,y4=0,y5=0,y6=0,y7=0,y8=0,y9=0,y0=0;
      |     ~~^~
/in/foo.cc:9:52: error: assignment of function 'double y0(double)'
    9 |     y1=0,y2=0,y3=0,y4=0,y5=0,y6=0,y7=0,y8=0,y9=0,y0=0;
      |                                                  ~~^~
/in/foo.cc:11:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(arr[i]==1&&y1<1){cout<<arr[i]<<" ";y1++;}
      |                       ~~^~
/in/foo.cc:11:47: warning: ISO C++ forbids incrementing a pointer of type 'double (*)(double) noexcept' {aka 'double (*)(double)'} [-Wpointer-arith]
   11 |         if(arr[i]==1&&y1<1){cout<<arr[i]<<" ";y1++;}
      |                                               ^~
/in/foo.cc:11:47: error: lvalue required as increment operand
/in/foo.cc:20:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         if(arr[i]==0&&y0<1){cout<<arr[i]<<" ";y0++;}
      |                       ~~^~
/in/foo.cc:20:47: warning: ISO C++ forbids incrementing a pointer of type 'double (*)(double) noexcept' {aka 'double (*)(double)'} [-Wpointer-arith]
   20 |         if(arr[i]==0&&y0<1){cout<<arr[i]<<" ";y0++;}
      |                                               ^~
/in/foo.cc:20:47: error: lvalue required as increment operand
/in/foo.cc:22:24: error: 'y11' was not declared in this scope; did you mean 'y1l'?
   22 |         if(arr[i]==11&&y11<1){cout<<arr[i]<<" ";y11++;}
      |                        ^~~
      |                        y1l

信息

递交者
类型
递交
题目
P1054 A10-3 数组的去重
语言
C++
递交时间
2026-06-26 09:56:19
评测时间
2026-06-26 09:56:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes