foo.cc:6:25: error: conflicting declaration 'int a'
int Findmax(int a[],int a);
^
foo.cc:6:19: note: previous declaration as 'int* a'
int Findmax(int a[],int a);
^
foo.cc:7:25: error: conflicting declaration 'int a'
int Findmin(int a[],int a);
^
foo.cc:7:19: note: previous declaration as 'int* a'
int Findmin(int a[],int a);
^
foo.cc: In function 'int main()':
foo.cc:15:16: error: void value not ignored as it ought to be
int n=Input (a);
^
foo.cc:16:12: error: too many arguments to function 'void Output(int*)'
Output(a,n);
^
foo.cc:5:6: note: declared here
void Output (int a[]);
^~~~~~
foo.cc:18:6: error: 'imax' was not declared in this scope
max=imax;min=imin;
^~~~
foo.cc:18:6: note: suggested alternative: 'max'
max=imax;min=imin;
^~~~
max
foo.cc:18:15: error: 'imin' was not declared in this scope
max=imax;min=imin;
^~~~
foo.cc:18:15: note: suggested alternative: 'min'
max=imax;min=imin;
^~~~
min
foo.cc:19:32: error: invalid conversion from 'int*' to 'int' [-fpermissive]
int k=Search(a,n,min,max,index);
^
foo.cc:8:5: note: initializing argument 5 of 'int Search(int*, int, int, int, int)'
int Search(int a[], int n, int min, int max, int index);
^~~~~~
foo.cc:20:6: error: 'iint' was not declared in this scope
for(iint i=0;i<k;i++)
^~~~
foo.cc:20:6: note: suggested alternative: 'uint'
for(iint i=0;i<k;i++)
^~~~
uint
foo.cc:20:15: error: 'i' was not declared in this scope
for(iint i=0;i<k;i++)
^
foo.cc:22:11: error: 'idex' was not declared in this scope
cout<<a[idex[i]]<<endl;
^~~~
foo.cc:22:11: note: suggested alternative: 'index'
cout<<a[idex[i]]<<endl;
^~~~
index
foo.cc: In function 'int main()':
foo.cc:27:5: error: redefinition of 'int main()'
int main()
^~~~
foo.cc:12:5: note: 'int main()' previously defined here
int main()
^~~~
foo.cc:29:7: error: 'a' was not declared in this scope
cin>>a[];
^
foo.cc:29:9: error: expected primary-expression before ']' token
cin>>a[];
^
foo.cc:30:11: error: expected primary-expression before ']' token
return a[];
^
foo.cc: In function 'int main()':
foo.cc:34:5: error: redefinition of 'int main()'
int main()
^~~~
foo.cc:12:5: note: 'int main()' previously defined here
int main()
^~~~
foo.cc:36:9: error: 'a' was not declared in this scope
return a[];
^
foo.cc:36:11: error: expected primary-expression before ']' token
return a[];
^
foo.cc: At global scope:
foo.cc:39:25: error: conflicting declaration 'int a'
int Findmin(int a[],int a)
^
foo.cc:39:19: note: previous declaration as 'int* a'
int Findmin(int a[],int a)
^
foo.cc: In function 'int Findmin(int*)':
foo.cc:42:16: error: 'n' was not declared in this scope
for(int i=1;i<n;i++)
^
foo.cc:44:13: error: 'imin' was not declared in this scope
if(a[i]<a[imin])
^~~~
foo.cc:44:13: note: suggested alternative: 'ima'
if(a[i]<a[imin])
^~~~
ima
foo.cc:47:9: error: 'imin' was not declared in this scope
return imin;
^~~~
foo.cc:47:9: note: suggested alternative: 'ima'
return imin;
^~~~
ima
foo.cc:41:6: warning: unused variable 'ima' [-Wunused-variable]
int ima=0;
^~~
foo.cc: At global scope:
foo.cc:50:25: error: conflicting declaration 'int a'
int Findmax(int a[],int a)
^
foo.cc:50:19: note: previous declaration as 'int* a'
int Findmax(int a[],int a)
^
foo.cc: In function 'int Findmax(int*)':
foo.cc:53:17: error: 'n' was not declared in this scope
for(int i=0; i>n;i--)
^
foo.cc: In function 'int Search(int*, int, int, int, int)':
foo.cc:63:9: error: declaration of 'int a [5]' shadows a parameter
int a[5],index[10];
^
foo.cc:63:19: error: declaration of 'int index [10]' shadows a parameter
int a[5],index[10];
^
foo.cc:64:6: error: declaration of 'int n' shadows a parameter
int n=Input (a);
^
foo.cc:64:16: error: void value not ignored as it ought to be
int n=Input (a);
^
foo.cc:65:12: error: too many arguments to function 'void Output(int*)'
Output(a,n);
^
foo.cc:5:6: note: declared here
void Output (int a[]);
^~~~~~
foo.cc:66:6: error: declaration of 'int max' shadows a parameter
int max,min;
^~~
foo.cc:66:10: error: declaration of 'int min' shadows a parameter
int max,min;
^~~
foo.cc:67:6: error: 'imax' was not declared in this scope
max=imax;min=imin;
^~~~
foo.cc:67:6: note: suggested alternative: 'max'
max=imax;min=imin;
^~~~
max
foo.cc:67:15: error: 'imin' was not declared in this scope
max=imax;min=imin;
^~~~
foo.cc:67:15: note: suggested alternative: 'min'
max=imax;min=imin;
^~~~
min
foo.cc:68:32: error: invalid conversion from 'int*' to 'int' [-fpermissive]
int k=Search(a,n,min,max,index);
^
foo.cc:61:5: note: initializing argument 5 of 'int Search(int*, int, int, int, int)'
int Search(int a[], int n, int min, int max, int index)
^~~~~~
foo.cc: At global scope:
foo.cc:78:1: error: expected unqualified-id before '{' token
{
^
foo.cc:87:1: error: expected unqualified-id before '{' token
{
^
foo.cc: In function 'int Unijque(int*, int)':
foo.cc:98:25: error: too few arguments to function 'int Search(int*, int, int, int, int)'
if(Search ( a,i-k,a[i])!=-1)
^
foo.cc:61:5: note: declared here
int Search(int a[], int n, int min, int max, int index)
^~~~~~
foo.cc:103:11: error: 'i' was not declared in this scope
return a[i];
^
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。