Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int n;
int array[100];
int main(){
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> array[i];
    }
    for(int j=1;j<n;j++){
        int key = array[j];
        i = j-1;
        while(i>0 && array[i] > key){
            array[i+1] = array[i];
            i = i-1;
        }
        array[i+1] = key;
        for(int i=0;i<n;i++){
            cout << array[i];
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: reference to 'array' is ambiguous
   11 |         cin >> array[i];
      |                ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 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/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:14:19: error: reference to 'array' is ambiguous
   14 |         int key = array[j];
      |                   ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |         i = j-1;
      |         ^
a.cc:16:22: error: reference to 'array' is ambiguous
   16 |         while(i>0 && array[i] > key){
      |                      ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:17:13: error: reference to 'array' is ambiguous
   17 |             array[i+1] = array[i];
      |             ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:17:26: error: reference to 'array' is ambiguous
   17 |             array[i+1] = array[i];
      |                          ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:20:9: error: reference to 'array' is ambiguous
   20 |         array[i+1] = key;
      |         ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~
a.cc:22:21: error: reference to 'array' is ambiguous
   22 |             cout << array[i];
      |                     ^~~~~
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:7:5: note:                 'int array [100]'
    7 | int array[100];
      |     ^~~~~