Language: C++

#include<iostream>
using namespace std;
const int maxn=200000+5;
int n,a[maxn],clone[maxn],ans[maxn];
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        clone[i]=a[i];
    }
    /*for(int i=0;i<n;i++){
        cout<<clone[i]<<" ";
    }*/
    int temp;
    for(int i=0;i<n;i++){
        temp=clone[i];
        clone[i]=0;
        sort(clone,clone+n);
        cout<<clone[n-1]<<endl;
        for(int j=0;j<n;j++){
            clone[j]=a[j];
        }
        clone[i]=temp;
    }
    return 0;
}

Compiler output:
a.cc:4:25: error: 'int clone [200005]' redeclared as different kind of entity
    4 | int n,a[maxn],clone[maxn],ans[maxn];
      |                         ^
In file included from /usr/include/sched.h:43,
                 from /usr/include/pthread.h:22,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/sched.h:132:12: note: previous declaration 'int clone(int (*)(void*), void*, int, void*, ...)'
  132 | extern int clone (int (*__fn) (void *__arg), void *__child_stack,
      |            ^~~~~
a.cc: In function 'int main()':
a.cc:9:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    9 |         clone[i]=a[i];
      |                ^
a.cc:9:17: error: assignment of read-only location '*(clone + ((sizetype)i))'
    9 |         clone[i]=a[i];
      |         ~~~~~~~~^~~~~
a.cc:16:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |         temp=clone[i];
      |                     ^
a.cc:16:21: error: invalid conversion from 'int (*)(int (*)(void*), void*, int, void*, ...) noexcept' to 'int' [-fpermissive]
   16 |         temp=clone[i];
      |              ~~~~~~~^
      |                     |
      |                     int (*)(int (*)(void*), void*, int, void*, ...) noexcept
a.cc:17:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |         clone[i]=0;
      |                ^
a.cc:17:17: error: assignment of read-only location '*(clone + ((sizetype)i))'
   17 |         clone[i]=0;
      |         ~~~~~~~~^~
a.cc:18:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |         sort(clone,clone+n);
      |                    ~~~~~^~
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |         sort(clone,clone+n);
      |         ^~~~
      |         short
a.cc:19:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |         cout<<clone[n-1]<<endl;
      |                        ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:21:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |             clone[j]=a[j];
      |                    ^
a.cc:21:21: error: assignment of read-only location '*(clone + ((sizetype)j))'
   21 |             clone[j]=a[j];
      |             ~~~~~~~~^~~~~
a.cc:23:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |         clone[i]=temp;
      |                ^
a.cc:23:17: error: assignment of read-only location '*(clone + ((sizetype)i))'
   23 |         clone[i]=temp;
      |         ~~~~~~~~^~~~~