记录详情

Compile Error

foo.cc:5:18: error: invalid declarator before '&' token
    5 | void(vector<int> &v)
      |                  ^
foo.cc:5:17: error: expected ')' before '&' token
    5 | void(vector<int> &v)
      |     ~           ^~
      |                 )
foo.cc: In function 'int Search(std::vector<int>&, int)':
foo.cc:13:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for(int i=0;i<v.size();i++)
      |              ~^~~~~~~~~
foo.cc:13:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   13 |  for(int i=0;i<v.size();i++)
      |  ^~~
foo.cc:16:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   16 |   return -1;
      |   ^~~~~~
foo.cc: In function 'int main()':
foo.cc:22:6: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
   22 |  if(x*y)
      |     ~^~
foo.cc:24:8: error: 'x1' was not declared in this scope; did you mean 'x'?
   24 |  x=abs(x1);
      |        ^~
      |        x
foo.cc:25:10: error: no matching function for call to 'abs(double (&)(double) throw ())'
   25 |  y=abs(y1);
      |          ^
In file included from /usr/include/c++/9/cstdlib:75,
                 from /usr/include/c++/9/ext/string_conversions.h:41,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/stdlib.h:840:12: note: candidate: 'int abs(int)' <near match>
  840 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/usr/include/stdlib.h:840:12: note:   conversion of argument 1 would be ill-formed:
foo.cc:25:8: error: invalid conversion from 'double (*)(double) throw ()' {aka 'double (*)(double)'} to 'int' [-fpermissive]
   25 |  y=abs(y1);
      |        ^~
      |        |
      |        double (*)(double) throw () {aka double (*)(double)}
In file included from /usr/include/c++/9/cstdlib:77,
                 from /usr/include/c++/9/ext/string_conversions.h:41,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' <near match>
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/9/bits/std_abs.h:61:3: note:   conversion of argument 1 would be ill-formed:
foo.cc:25:8: error: invalid conversion from 'double (*)(double) throw ()' {aka 'double (*)(double)'} to 'long long int' [-fpermissive]
   25 |  y=abs(y1);
      |        ^~
      |        |
      |        double (*)(double) throw () {aka double (*)(double)}
In file included from /usr/include/c++/9/cstdlib:77,
                 from /usr/include/c++/9/ext/string_conversions.h:41,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/bits/locale_classes.h:40,
                 from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/ostream:38,
                 from /usr/include/c++/9/iostream:39,
                 from foo.cc:1:
/usr/include/c++/9/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' <near match>
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
/usr/include/c++/9/bits/std_abs.h:56:3: note:   conversion of argument 1 would be ill-formed:
foo.cc:25:8: error: invalid conversion from 'double (*)(double) throw ()' {aka 'double (*)(double)'} to 'long int' [-fpermissive]
   25 |  y=abs(y1);
      |        ^~
      |        |
      |        double (*)(double) throw () {aka double (*)(double)}
foo.cc:38:3: warning: left operand of comma operator has no effect [-Wunused-value]
   38 |  x%y,x*=10;
      |  ~^~
foo.cc:45:19: error: expected ';' before 'else'
   45 |    r.push_back(-1)
      |                   ^
      |                   ;
   46 |   else
      |   ~~~~             
foo.cc:51:3: error: 'Output' was not declared in this scope
   51 |   Output(q);
      |   ^~~~~~
foo.cc:57:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |   for(int i=flag-1;i<q.size();i++)
      |                    ~^~~~~~~~~
foo.cc:58:10: error: 'a' was not declared in this scope
   58 |    cout<<a[i];
      |          ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A11-5 小数的循环节
比赛
2022暑期青少年社团(训练赛)
语言
C++
递交时间
2022-08-07 21:33:11
评测时间
2022-08-07 21:33:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes