foo.cc: In function 'void a(int*, int, int)':
foo.cc:15:23: error: expected primary-expression before 'int'
15 | judge(int* a,int n,int y);
| ^~~
foo.cc:15:30: error: expected primary-expression before 'int'
15 | judge(int* a,int n,int y);
| ^~~
foo.cc:15:36: error: expected primary-expression before 'int'
15 | judge(int* a,int n,int y);
| ^~~
foo.cc:14:21: warning: unused variable 'y' [-Wunused-variable]
14 | int y=x%10;
| ^
foo.cc: In function 'int max(int, int, int)':
foo.cc:21:25: error: invalid types 'int[int]' for array subscript
21 | if(x<buc[i]){
| ^
foo.cc: In function 'int main()':
foo.cc:35:23: error: no matching function for call to 'max(int [10], int, int&)'
35 | if(max(buc,10,buc[i])!=-1){
| ~~~^~~~~~~~~~~~~~~
foo.cc:19:5: note: candidate: 'int max(int, int, int)' (near match)
19 | int max(int buc,int n,int x){
| ^~~
foo.cc:19:5: note: conversion of argument 1 would be ill-formed:
foo.cc:35:24: error: invalid conversion from 'int*' to 'int' [-fpermissive]
35 | if(max(buc,10,buc[i])!=-1){
| ^~~
| |
| int*
In file included from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/string:50,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ios:42,
from /nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/ostream:38,
from iostream:39:
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
foo.cc:35:23: note: deduced conflicting types for parameter 'const _Tp' ('int [10]' and 'int')
35 | if(max(buc,10,buc[i])!=-1){
| ~~~^~~~~~~~~~~~~~~
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/nix/store/1x1q5sqa0ilbi8fz7aayk02pjy5g7jhh-gcc-12.3.0/include/c++/12.3.0/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
foo.cc:35:23: note: deduced conflicting types for parameter 'const _Tp' ('int [10]' and 'int')
35 | if(max(buc,10,buc[i])!=-1){
| ~~~^~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务