criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N, j, v;
  cin >> N;
  int s[N];

  for (size_t i = 0; i < N; i++) {
    cin >> s[i];
  }

  for (size_t i = 0; i < N; i++) {
    v = s[i];
    j = i-1;
    while (j >= 0 && s[j] > v) {
      s[j+1] = s[j];
      j -= 1;
    }
    s[j+1] = v
    for (size_t i = 0; i < n; i++) {
      cout << s[i];
      if (i < N-1) {
        cout << " ";
      }
    }
  }

  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected ';' before 'for'
   20 |     s[j+1] = v
      |               ^
      |               ;
   21 |     for (size_t i = 0; i < n; i++) {
      |     ~~~        
a.cc:21:28: error: 'n' was not declared in this scope
   21 |     for (size_t i = 0; i < n; i++) {
      |                            ^
a.cc:21:34: error: expected ';' before ')' token
   21 |     for (size_t i = 0; i < n; i++) {
      |                                  ^
      |                                  ;
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N, j, v;
  cin >> N;
  int s[N];

  for (size_t i = 0; i < N; i++) {
    cin >> s[i];
  }

  for (size_t i = 0; i < N; i++) {
    v = s[i];
    j = i-1;
    while (j >= 0 && s[j] > v) {
      s[j+1] = s[j];
      j -= 1;
    }
    s[j+1] = v;
    for (size_t i = 0; i < n; i++) {
      cout << s[i];
      if (i < N-1) {
        cout << " ";
      }
    }
  }

  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: 'n' was not declared in this scope
   21 |     for (size_t i = 0; i < n; i++) {
      |                            ^
Language: C++


l = input
A = input().strip()

for i in range(1,l):
    j = i-1
    v = A[i]
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
        
    A[j+1] = v
    
    s = [str(a) for a in A]
    
    print(' '.join(s))

    
            

Compiler output:
a.cc:2:1: error: 'l' does not name a type
    2 | l = input
      | ^
Language: C++

#include<iostream>
#include<windows.h>
using namespace std;

void insertionSort(int A[], int N) {
	int v, j;
	for (int i = 1; i < N; i++) {
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		
		A[j + 1] = v;

		for (int i = 0; i < N; i++) {
			if (i > 0) cout << " ";
			cout << A[i];
		}

		cout << endl;
	}
}


int main(void) {
	int N;
	int A[100];

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	insertionSort(A, N);

	Sleep(6000);

	return 0;
}

Compiler output:
a.cc:2:9: fatal error: windows.h: No such file or directory
    2 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<windows.h>
using namespace std;

void trace(int A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i > 0) cout << " ";
		cout << A[i];
	}

	cout << endl;
}

void insertionSort(int A[], int N) {
	int v, j;
	for (int i = 1; i < N; i++) {

		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		
		trace(A, N);

	}
}


int main(void) {
	int N;
	int A[100];

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	trace(A, N);
	insertionSort(A, N);

	Sleep(6000);

	return 0;
}

Compiler output:
a.cc:2:9: fatal error: windows.h: No such file or directory
    2 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>

void trace(int A[],int N){
int i;
for(i=0;i<N;i++){
if(i>0)printf(" ");
printf(%d,A[i]);
}
printf("\n");
}

void insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]=v){
A[j+1]=A[j];
j--;
}
A[i+1]=v;
trace(A,N);
}
}

int main(){
int N,i,j;
int A[100];

scanf("%d",&N);
for(i=0;i<N;i++)scanf("%d",&A[i]);

trace(A,N);
insertionSort(A,N);

return 0;
}

Compiler output:
a.cc: In function 'void trace(int*, int)':
a.cc:7:8: error: expected primary-expression before '%' token
    7 | printf(%d,A[i]);
      |        ^
a.cc:7:9: error: 'd' was not declared in this scope
    7 | printf(%d,A[i]);
      |         ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:17:11: error: lvalue required as left operand of assignment
   17 | while(j>=0&&A[j]=v){
      |       ~~~~^~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

void trace(int A[],int N){
int i;
for(i=0;i<N;i++){
if(i>0)printf(" ");
printf(%d,A[i]);
}
printf("\n");
}

void insertionSort(int A[],int N){
int j,i,v;
for(i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]=v){
A[j+1]=A[j];
j--;
}
A[i+1]=v;
trace(A,N);
}
}

int main(){
int N,i,j;
int A[100];

scanf("%d",&N);
for(i=0;i<N;i++)scanf("%d",&A[i]);

trace(A,N);
insertionSort(A,N);

return 0;
}

Compiler output:
a.cc: In function 'void trace(int*, int)':
a.cc:8:8: error: expected primary-expression before '%' token
    8 | printf(%d,A[i]);
      |        ^
a.cc:8:9: error: 'd' was not declared in this scope
    8 | printf(%d,A[i]);
      |         ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:18:11: error: lvalue required as left operand of assignment
   18 | while(j>=0&&A[j]=v){
      |       ~~~~^~~~~~
Language: C++

import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
		int [] array = new int[length];
		
		for (int i = 0; i < length; i++) {
			array[i] = sc.nextInt();
		}
		
		for (int i = 0; i < length; i++) {

			for (int j = 0; j < i; j++) {
				if (array[j] > array[i]) {
					int temp = array[i];
					for (int k = i - 1; k >= j; k--) {
						array[k + 1] = array[k];
					}
					array[j] = temp;
				}
			}

			for (int j = 0; j < length; j++) {
				System.out.print(array[j]);
				if (j != length - 1) {
					System.out.println(" ");
				}
			}
			System.out.println("");
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:15: error: expected ':' before 'static'
    3 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:3:33: error: 'String' has not been declared
    3 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:3:42: error: expected ',' or '...' before 'args'
    3 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:33:2: error: expected ';' after class definition
   33 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:17: error: 'Scanner' was not declared in this scope
    4 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:5:30: error: 'sc' was not declared in this scope
    5 |                 int length = sc.nextInt();
      |                              ^~
a.cc:6:21: error: structured binding declaration cannot have type 'int'
    6 |                 int [] array = new int[length];
      |                     ^~
a.cc:6:21: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:21: error: empty structured binding declaration
a.cc:6:24: error: expected initializer before 'array'
    6 |                 int [] array = new int[length];
      |                        ^~~~~
a.cc:9:25: error: 'array' was not declared in this scope
    9 |                         array[i] = sc.nextInt();
      |                         ^~~~~
a.cc:15:37: error: 'array' was not declared in this scope
   15 |                                 if (array[j] > array[i]) {
      |                                     ^~~~~
a.cc:25:33: error: 'System' was not declared in this scope
   25 |                                 System.out.print(array[j]);
      |                                 ^~~~~~
a.cc:25:50: error: 'array' was not declared in this scope
   25 |                                 System.out.print(array[j]);
      |                                                  ^~~~~
a.cc:30:25: error: 'System' was not declared in this scope
   30 |                         System.out.println("");
      |                         ^~~~~~
Language: C++

#include <cstdio>

using namespace std;

const int MAX_N = 100;
int N;
int A[MAX_N];

void insertionSort(int *a, int n);

void show(int *a, int n) {
	for (int i = 0; i < n; i++) {
		printf("%d", *(a + i));
		if (i != n - 1) printf(" ")
	}
	printf("\n");
}

void solve() {
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", A + i);
	}
	insertionSort(A, N);
}

int main() {
	solve();
}

void insertionSort(int *a, int n) {
	int v;

	show(a, N);

	for (int i = 1; i <= n - 1; i++) {
		v = a[i];
		int j = i - 1;
		while (j >= 0 && a[j] > v) {
			a[j + 1] = a[j];
			j--;
			a[j + 1] = v;
		}
		show(a, N);
	}
}

Compiler output:
a.cc: In function 'void show(int*, int)':
a.cc:14:44: error: expected ';' before '}' token
   14 |                 if (i != n - 1) printf(" ")
      |                                            ^
      |                                            ;
   15 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;
void sort(int A[],int N);
void sort(int A[],int N){
	int i,j,v;
	for(i=1;i<N;++i){
		v=A[i];
		j=i-1;
		while(j>=0&&A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
	}
}

int _tmain(int argc, _TCHAR* argv[])
{
	int N,A[114514];
	int i;
	cin>>N;
	for(int i=0;i<N;i++) cin >>A[i];
	sort(A,N);

	for(i=0;i<N;i++) printf("%d",A[i]);
	return 0;
}

Compiler output:
a.cc:17:22: error: '_TCHAR' has not been declared
   17 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

#include <iostream>
using namespace std;
static const int N = 1000;

void trace(int a[],int n){
    for (int i=0;i<n;i++){
        if (i>0) cout << " "
        cout << a[i];
    }
}
int insertionSort(int a[], int n){
    int temp;
    for (int i=0;i<n;i++){
        for (int j=i-1;j>0;j--){
            if (a[i]<a[j]){
                a[j]=temp;
                a[j]=a[i];
                a[i]=temp;
                i--;
            }
            else{
                break;
            }
        }
    }
    trace(a,n);
}
int main(){
    int n,i;
    int a[100];
    while(cin>>n){
        for (i=0;i<n;i++){
            cin>>a[i];
        }
        trace(a,n);
        insertionSort(a,n);
    }
    return 0;
}

Compiler output:
a.cc: In function 'void trace(int*, int)':
a.cc:7:29: error: expected ';' before 'cout'
    7 |         if (i>0) cout << " "
      |                             ^
      |                             ;
    8 |         cout << a[i];
      |         ~~~~                 
a.cc: In function 'int insertionSort(int*, int)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
static const int N = 1000;

void trace(int a[],int n){
    for (int i=0;i<n;i++){
        if (i>0) cout << " ";
        cout << a[i];
    }
}
void insertionSort(int a[], int n){
    int temp;
    for (int i=0;i<n;i++){
        for (int j=i-1;j>0;j--){
            if (a[i]<a[j]){
                a[j]=temp;
                a[j]=a[i];
                a[i]=temp;
                i--;
            }
            else{
                break;
            }
        }
    }
    trace(a,n);
}
int main(){
    int n,i;
    int a[100];
    while(cin>>n){
        for (i=0;i<n;i++){
            cin>>a[i];
        }
        trace(a,n);
        insertionSort(a,n);
    }
    return 0;
}
    }
    trace(a,n);
}
int main(){
    int n,i;
    int a[100];
    while(cin>>n){
        for (i=0;i<n;i++){
            cin>>a[i];
        }
        trace(a,n);
        insertionSort(a,n);
    }
    return 0;
}

Compiler output:
a.cc:40:5: error: expected declaration before '}' token
   40 |     }
      |     ^
a.cc:41:10: error: expected constructor, destructor, or type conversion before '(' token
   41 |     trace(a,n);
      |          ^
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main(){
      |     ^~~~
a.cc:28:5: note: 'int main()' previously defined here
   28 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
static const int N = 1000;

void trace(int a[],int n){
    for (int i=0;i<n;i++){
        if (i>0) {cout << " ";}
        cout << a[i];
    }
    cout << endl;
}

void insertionSort(int a[], int n){
    int temp;
    for (int i=0;i<n;i++){
        a[i] = v;
        for (int j=i-1;j>=0;j--){
            if (v<a[j]){
                a[j+1]=a[j]
            }else{
                break;
            }
        a[j+1]=v;
        }
        trace(a,n);
    }
    
}

int main(){
    int n,i;
    int a[100];
    while(cin>>n){
        for (i=0;i<n;i++){
            cin>>a[i];
        }
        trace(a,n);
        insertionSort(a,n);
    }
    return 0;
}

Compiler output:
a.cc: In function 'void insertionSort(int*, int)':
a.cc:16:16: error: 'v' was not declared in this scope
   16 |         a[i] = v;
      |                ^
a.cc:19:28: error: expected ';' before '}' token
   19 |                 a[j+1]=a[j]
      |                            ^
      |                            ;
   20 |             }else{
      |             ~
Language: C++

#include <iostream>
using namespace std;
static const int N = 1000;

void trace(int a[],int n){
    for (int i=0;i<n;i++){
        if (i>0) {
            cout << " ";
        }
        cout << a[i];
    }
    cout << endl;
}

void insertionSort(int a[], int n){
    int v,j;
    for (int i=1;i<n;i++){
        v=a[j];
        j = i-1;
        while(j>=0&&v<a[j]){
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=v;
        trace(a,n);
    }
    
}

int main(){
    int n,i;
    int a[N];
    cin>>n
    for (i=0;i<n;i++){
            cin>>a[i];
    }
    trace(a,n);
    insertionSort(a,n);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:11: error: expected ';' before 'for'
   33 |     cin>>n
      |           ^
      |           ;
   34 |     for (i=0;i<n;i++){
      |     ~~~    
a.cc:34:21: error: expected ';' before ')' token
   34 |     for (i=0;i<n;i++){
      |                     ^
      |                     ;
Language: C++

#include <stdio.h>
#include <iostream>
using namespace std;

int main(void)
{
	int n;
	cin >> n;
	
	int i = 0, a[100];
	while (cin >> a[i++]) {};
	
	insertionSort(a, n);
	
	return 0;
}

void insertionSort(int ary[], int num)
{
	outputArray(ary, num);
	
	int i;
	for (i = 1; i < num; i++) {
		int v = ary[i];
		int j = i - 1;
		while (j >= 0 && ary[j] > v) {
			ary[j+1] = ary[j];
			j--;
		}
		ary[j+1] = v;
		
		outputArray(ary, num);
	}
}

void outputArray(int ary[], int num)
{
	for(int i = 0; i < num - 1; i++){
		cout << ary[i] << " ";
	}
	cout << ary[num-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'insertionSort' was not declared in this scope
   13 |         insertionSort(a, n);
      |         ^~~~~~~~~~~~~
a.cc: In function 'void insertionSort(int*, int)':
a.cc:20:9: error: 'outputArray' was not declared in this scope
   20 |         outputArray(ary, num);
      |         ^~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>

void
insertionSort(int *data, int size)
{
    int i;
    int j;
    int v;

    for (i=1; i<size; ++i) {
        v = data[i];
        j = i - 1;
        while ((j>=0)&&(data[j]>v)) {
            data[j+1] = data[j];
            --j;
        }
        data[j+1] = v;
        for (i=0; i<size-1; ++i) {
            printf("%d ", data[i]);
        }
        printf("%d\n", data[i]);
    }

}

int main(int argc, int *argv[])
{
    int size;
    int *data;

    scanf("%d", &size);
    data = malloc(size * sizeof(int));

    insertionSort(data, size);

    return 0;
}

Compiler output:
a.cc:27:5: warning: second argument of 'int main(int, int**)' should be 'char **' [-Wmain]
   27 | int main(int argc, int *argv[])
      |     ^~~~
a.cc: In function 'int main(int, int**)':
a.cc:33:18: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   33 |     data = malloc(size * sizeof(int));
      |            ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  void*
Language: C++

#include<iostream>
#include<stdio>
using namespace std;

int main(){
  int N, v, j, A[1000];

  cin >> N;

  for (int i=0; i<N; i++){
    cin >> A[i];
  }

  for (int i=1; i<N; i++){
    v=A[i];
    j=i-1;
    while((j>=0)&&(A[j]>v)){
      A[j+1]=A[j];
      j--;
    }

    A[j+1]=v;

      for (int i=0; i<N; i++){
    cout << A[i];
    if(i==N-1)
      printf("\n");
      else printf(" ");
  }
  }



  return 0;
}

Compiler output:
a.cc:2:9: fatal error: stdio: No such file or directory
    2 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int main(){
  int N, v, j, A[1000];

  cin >> N;

  for (int i=0; i<N; i++){
    cin >> A[i];
  }

  
      for (int i=0; i<N; i++){
    cout << A[i];
    if(i==N-1)
      printf("\n");
      else printf(" ");
  }

  for (int i=1; i<N; i++){
    v=A[i];
    j=i-1;
    while((j>=0)&&(A[j]>v)){
      A[j+1]=A[j];
      j--;
    }

    A[j+1]=v;

      for (int i=0; i<N; i++){
    cout << A[i];
    if(i==N-1)
      printf("\n");
      else printf(" ");
  }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:38:4: error: expected '}' at end of input
   38 |   }
      |    ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

void trace(int a[], int n) {
  int i;
  for(int i = 0; i < n; ++i) {
    if(i > 0) {
      cout << " " << endl;
    }
    cout << a[i] << endl;
  }
}

void insertionSort(a, n) {
   int v, j;
  for(int i = 1; i < n - 1; ++i) {
     v = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
       --j;
    }
  }
  a[j + 1] = v;
  trace(a, n);
}

int main() {
  int n;
  cin >> n;
  int m[n];
  for(int i = 0; i < n; ++i) {
    cin >> m[i];
  }
  trace(m, n);
  insertionSort(m, n);
}

Compiler output:
a.cc:15:6: error: variable or field 'insertionSort' declared void
   15 | void insertionSort(a, n) {
      |      ^~~~~~~~~~~~~
a.cc:15:20: error: 'a' was not declared in this scope
   15 | void insertionSort(a, n) {
      |                    ^
a.cc:15:23: error: 'n' was not declared in this scope
   15 | void insertionSort(a, n) {
      |                       ^
a.cc: In function 'int main()':
a.cc:37:3: error: 'insertionSort' was not declared in this scope
   37 |   insertionSort(m, n);
      |   ^~~~~~~~~~~~~
Language: C++

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

void trace(int a[], int n) {
  int i;
  for(int i = 0; i < n; ++i) {
    if(i > 0) {
      cout << " " << endl;
    }
    cout << a[i] << endl;
  }
}

void insertionSort(int a, int n) {
   int v, j;
  for(int i = 1; i < n - 1; ++i) {
     v = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
       --j;
    }
  }
  a[j + 1] = v;
  trace(a, n);
}

int main() {
  int n;
  cin >> n;
  int m[n];
  for(int i = 0; i < n; ++i) {
    cin >> m[i];
  }
  trace(m, n);
  insertionSort(m, n);
}

Compiler output:
a.cc: In function 'void insertionSort(int, int)':
a.cc:18:11: error: invalid types 'int[int]' for array subscript
   18 |      v = a[i];
      |           ^
a.cc:20:22: error: invalid types 'int[int]' for array subscript
   20 |     while(j >= 0 && a[j] > v) {
      |                      ^
a.cc:21:8: error: invalid types 'int[int]' for array subscript
   21 |       a[j + 1] = a[j];
      |        ^
a.cc:21:19: error: invalid types 'int[int]' for array subscript
   21 |       a[j + 1] = a[j];
      |                   ^
a.cc:25:4: error: invalid types 'int[int]' for array subscript
   25 |   a[j + 1] = v;
      |    ^
a.cc:26:9: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   26 |   trace(a, n);
      |         ^
      |         |
      |         int
a.cc:5:16: note:   initializing argument 1 of 'void trace(int*, int)'
    5 | void trace(int a[], int n) {
      |            ~~~~^~~
a.cc: In function 'int main()':
a.cc:37:17: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   37 |   insertionSort(m, n);
      |                 ^
      |                 |
      |                 int*
a.cc:15:24: note:   initializing argument 1 of 'void insertionSort(int, int)'
   15 | void insertionSort(int a, int n) {
      |                    ~~~~^
Language: C++

#include <stdio.h>
 
main(){
 
  int i = 0, j = 0, k = 0;
  int A[101];
  int N = 1;
  int key = 0;
   
  scanf("%d",&N);
   
  for (k=1;k<=N;k++){
    scanf("%d",&A[k]);
  }
     
  for (j=1;j<=N;j++){
    key = A[j];
    i = j - 1;
    while ((i>0) && (A[i]>key)){
      A[i+1] = A[i];
      i = i - 1;
    }
    A[i+1] = key;
    for (k=1;k<=N;k++){
      printf("%d",A[k]);
      if(k<N){
    printf(" ");
      }
    }
    printf("\n");
  }
 

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:31:4: error: expected '}' at end of input
   31 |   }
      |    ^
a.cc:3:7: note: to match this '{'
    3 | main(){
      |       ^
Language: C++

#include<iostream>
using namespace std;

int insertionSort(int A[], int N){
for(int i=1;i<=N;i++){
int v=A[i];
int j=i-1;
}
while(j >= 0 && A[j] > v){
A[j+1]=A[j];
j--;
A[j+1]=v;
}
return v;
}
int main(){
int a[],n;
cin >>n;
for(int i=1;i<=n;i++){
cin >>a[i];
cout <<insertionSort(a[],n) <<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int insertionSort(int*, int)':
a.cc:9:7: error: 'j' was not declared in this scope
    9 | while(j >= 0 && A[j] > v){
      |       ^
a.cc:9:24: error: 'v' was not declared in this scope
    9 | while(j >= 0 && A[j] > v){
      |                        ^
a.cc:14:8: error: 'v' was not declared in this scope
   14 | return v;
      |        ^
a.cc: In function 'int main()':
a.cc:17:5: error: storage size of 'a' isn't known
   17 | int a[],n;
      |     ^
a.cc:21:24: error: expected primary-expression before ']' token
   21 | cout <<insertionSort(a[],n) <<endl;
      |                        ^
Language: C++

#include<iostream>
using namespace std;
static const int N = 100;
void tarce(int A[], int n){
    for(int i = 0; i < n; i++){
        if(i > 1) cout << " ";
        cout << A[i];
    }
    cout << endl;
}
void InsertionSort(int A[], int n){
    for(int i = 1; i < n; i++){
        int targetA = A[i];
        int j = i - 1;
        while( j >= 0 && A[j] > targetA){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = targetA;
        trace(A,n);
    }
}
int main(){
    int n;
    int A[N+1];
    cin >> n;
    for(int i = 0; i < n; i++) cin >> A[i];
    trace(A,n);
    InsertionSort(A,n);
}

Compiler output:
a.cc: In function 'void InsertionSort(int*, int)':
a.cc:20:9: error: 'trace' was not declared in this scope; did you mean 'tarce'?
   20 |         trace(A,n);
      |         ^~~~~
      |         tarce
a.cc: In function 'int main()':
a.cc:28:5: error: 'trace' was not declared in this scope; did you mean 'tarce'?
   28 |     trace(A,n);
      |     ^~~~~
      |     tarce
Language: C++

int i, x, t;
for (i = 0; i < n; i++)
{
     t = a[i];
     x = i - 1;
     while(x > 0 && a[i] < a[x])
     {
          a[x + 1] = a[x];
          x--;
     }
     a[x + 1] = t;
     trace(A, n);
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before 'for'
    2 | for (i = 0; i < n; i++)
      | ^~~
a.cc:2:13: error: 'i' does not name a type
    2 | for (i = 0; i < n; i++)
      |             ^
a.cc:2:20: error: 'i' does not name a type
    2 | for (i = 0; i < n; i++)
      |                    ^
Language: C++

int i, x, t;
for (i = 0; i < n; i++)
{
     t = A[i];
     x = i - 1;
     while(x > 0 && A[i] < A[x])
     {
          A[x + 1] = A[x];
          x--;
     }
     A[x + 1] = t;
     trace(A, n);
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before 'for'
    2 | for (i = 0; i < n; i++)
      | ^~~
a.cc:2:13: error: 'i' does not name a type
    2 | for (i = 0; i < n; i++)
      |             ^
a.cc:2:20: error: 'i' does not name a type
    2 | for (i = 0; i < n; i++)
      |                    ^
Language: C++


#include<stdio.h>

static const int N = 1000;

void trace(int A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

int main(){
  int n, i, j;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
  
  trace(A, n);
  int i, x, t;
for (i = 0; i < n; i++)
{
     t = A[i];
     x = i - 1;
     while(x > 0 && A[i] < A[x])
     {
          A[x + 1] = A[x];
          x--;
     }
     A[x + 1] = t;
     trace(A, n);
}


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: redeclaration of 'int i'
   23 |   int i, x, t;
      |       ^
a.cc:16:10: note: 'int i' previously declared here
   16 |   int n, i, j;
      |          ^
Language: C++

#include<studio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++) scanf("%d",&a[i]);
     for(int i=1;i<N;i++){
          while(i>=0&&a[i]>a[i-1]){
                a[i-1]=dummy;
                a[i-1]=a[i];
                a[i]=dummy;
           }
           for(int j=0;j<(N-1);j++)printf("%d ",a[j]);
           printf("%d?\n",a[N]);
     }
     return 0;
}

Compiler output:
a.cc:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<studio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++) scanf("%d",&a[i]);
     for(int i=1;i<N;i++){
          int j=(i-1);
          while(j>=0&&a[j]<a[j-1]){
                a[j-1]=dummy;
                a[j-1]=a[j];
                a[j]=dummy;
                j--;
           }
           for(int k=0;k<(N-1);k++)printf("%d ",a[k]);
           printf("%d?\n",a[N]);
     }
     return 0;
}

Compiler output:
a.cc:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<studio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++) scanf("%d",&a[i]);
     for(int i=1;i<N;i++){
          int j=i;
          while(j>=0&&a[j]<a[j-1]){
                a[j-1]=dummy;
                a[j-1]=a[j];
                a[j]=dummy;
                j--;
           }
           for(int k=0;k<(N-1);k++)printf("%d ",a[k]);
           printf("%d?\n",a[N]);
     }
     return 0;
}

Compiler output:
a.cc:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<studio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++) scanf("%d",&a[i]);
     for(int i=1;i<N;i++){
          int j=i;
          while(j>0&&a[j]<a[j-1]){
                a[j-1]=dummy;
                a[j-1]=a[j];
                a[j]=dummy;
                j--;
           }
           for(int k=0;k<(N-1);k++)printf("%d ",a[k]);
           printf("%d?\n",a[N]);
     }
     return 0;
}

Compiler output:
a.cc:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<studio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++) scanf("%d",&a[i]);
     for(int i=1;i<N;i++){
          int j;
          j=i;
          while(j>0&&a[j]<a[j-1]){
                a[j-1]=dummy;
                a[j-1]=a[j];
                a[j]=dummy;
                j--;
           }
           for(int k=0;k<(N-1);k++)printf("%d ",a[k]);
           printf("%d?\n",a[N]);
     }
     return 0;
}

Compiler output:
a.cc:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
int main(){
     int N,a[100],dummy;
     scanf("%d",&N);
     for(int i=0;i<N;i++)scanf("%d",&a[i]);
     for(int i=0;i<(N-1);i++)printf("%d",a[i]);
     printf("%d",a[N-1])
     for(int i=1;i<N;i++){
          int j;
          j=i;
          while(j>0&&a[j]<a[j-1]){
                dummy=a[j-1];
                a[j-1]=a[j];
                a[j]=dummy;
                j--;
           }
           for(int k=0;k<(N-1);k++)printf("%d ",a[k]);
           printf("%d?\n",a[N-1]);
     }
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before 'for'
    7 |      printf("%d",a[N-1])
      |                         ^
      |                         ;
    8 |      for(int i=1;i<N;i++){
      |      ~~~                 
a.cc:8:18: error: 'i' was not declared in this scope
    8 |      for(int i=1;i<N;i++){
      |                  ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

void main()
{
	int length,i;
	cin >> length;
	vector<int>A;
	int element;
	for (int a = 0; a < length; a++)
	{
		cin >> element;
		A.push_back(element);
	}
	int key;
	for (i = 0; i < length; i++)
	{
		key = A[i];
		int j = i - 1;
		int k = i;
		for (; j >= 0; j--)
		{
			if (key < A[j])
			{
				for (; k > j; k--)
					A[k] = A[k - 1];
				A[j] = key;
			}
		}
		for (int a = 0; a < length; a++)
		{
			cout << A[a] << " " ;
		}
		cout << endl;
	}
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    vector<int>a(n);

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }   //??\???

    cout << a[0];
    for(int i = 1; i???< n; i++){
        cout << " " << a[i];
    }//??\???????????¨???
    cout << endl;
    
    for(int i = 1;i < n;++i){
        int j = i - 1,tmp = a[i];
        while(j >= 0 && a[j] > tmp){
            a[j + 1] = a[j];
            --j;
        }
        a[j + 1] = tmp;
        for(j = 0;j < n;++j){
            if(j) cout << " ";
            cout << a[j];
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc:14:22: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
   14 |     for(int i = 1; i???< n; i++){
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before '?' token
   14 |     for(int i = 1; i???< n; i++){
      |                      ^
a.cc:14:23: error: expected primary-expression before '?' token
   14 |     for(int i = 1; i???< n; i++){
      |                       ^
a.cc:14:24: error: expected primary-expression before '<' token
   14 |     for(int i = 1; i???< n; i++){
      |                        ^
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    vector<int>a(n);

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }   //??\???

    cout << a[0];
    for(int i = 1; i???< n; i++){
        cout << " " << a[i];
    }//??\???????????¨???
    cout << endl;

    for(int i = 1;i < n;++i){
        int j = i - 1,tmp = a[i];
        while(j >= 0 && a[j] > tmp){
            a[j + 1] = a[j];
            --j;
        }
        a[j + 1] = tmp;

        cout << a[0];
        for(j = ???;j < n;++j){
            cout << " " << a[j];
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc:14:22: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
   14 |     for(int i = 1; i???< n; i++){
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before '?' token
   14 |     for(int i = 1; i???< n; i++){
      |                      ^
a.cc:14:23: error: expected primary-expression before '?' token
   14 |     for(int i = 1; i???< n; i++){
      |                       ^
a.cc:14:24: error: expected primary-expression before '<' token
   14 |     for(int i = 1; i???< n; i++){
      |                        ^
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
a.cc:14:27: error: expected ':' before ';' token
   14 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:14:27: error: expected primary-expression before ';' token
a.cc:28:17: error: expected primary-expression before '?' token
   28 |         for(j = ???;j < n;++j){
      |                 ^
a.cc:28:18: error: expected primary-expression before '?' token
   28 |         for(j = ???;j < n;++j){
      |                  ^
a.cc:28:19: error: expected primary-expression before '?' token
   28 |         for(j = ???;j < n;++j){
      |                   ^
a.cc:28:20: error: expected primary-expression before ';' token
   28 |         for(j = ???;j < n;++j){
      |                    ^
a.cc:28:20: error: expected ':' before ';' token
   28 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:28:20: error: expected primary-expression before ';' token
a.cc:28:20: error: expected ':' before ';' token
   28 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:28:20: error: expected primary-expression before ';' token
a.cc:28:20: error: expected ':' before ';' token
   28 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:28:20: error: expected primary-expression before ';' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int a[100],n;
    cin >> n;

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }   //??\???

    cout << a[0];
    for(int i = 1; i???< n; i++){
        cout << " " << a[i];
    }//??\???????????¨???
    cout << endl;

    for(int i = 1;i < n;++i){
        int j = i - 1,tmp = a[i];
        while(j >= 0 && a[j] > tmp){
            a[j + 1] = a[j];
            --j;
        }
        a[j + 1] = tmp;

        cout << a[0];
        for(j = ???;j < n;++j){
            cout << " " << a[j];
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc:13:22: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
   13 |     for(int i = 1; i???< n; i++){
a.cc: In function 'int main()':
a.cc:13:22: error: expected primary-expression before '?' token
   13 |     for(int i = 1; i???< n; i++){
      |                      ^
a.cc:13:23: error: expected primary-expression before '?' token
   13 |     for(int i = 1; i???< n; i++){
      |                       ^
a.cc:13:24: error: expected primary-expression before '<' token
   13 |     for(int i = 1; i???< n; i++){
      |                        ^
a.cc:13:27: error: expected ':' before ';' token
   13 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:13:27: error: expected primary-expression before ';' token
a.cc:13:27: error: expected ':' before ';' token
   13 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:13:27: error: expected primary-expression before ';' token
a.cc:13:27: error: expected ':' before ';' token
   13 |     for(int i = 1; i???< n; i++){
      |                           ^
      |                           :
a.cc:13:27: error: expected primary-expression before ';' token
a.cc:27:17: error: expected primary-expression before '?' token
   27 |         for(j = ???;j < n;++j){
      |                 ^
a.cc:27:18: error: expected primary-expression before '?' token
   27 |         for(j = ???;j < n;++j){
      |                  ^
a.cc:27:19: error: expected primary-expression before '?' token
   27 |         for(j = ???;j < n;++j){
      |                   ^
a.cc:27:20: error: expected primary-expression before ';' token
   27 |         for(j = ???;j < n;++j){
      |                    ^
a.cc:27:20: error: expected ':' before ';' token
   27 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:27:20: error: expected primary-expression before ';' token
a.cc:27:20: error: expected ':' before ';' token
   27 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:27:20: error: expected primary-expression before ';' token
a.cc:27:20: error: expected ':' before ';' token
   27 |         for(j = ???;j < n;++j){
      |                    ^
      |                    :
a.cc:27:20: error: expected primary-expression before ';' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<LL> vl;
typedef vector<vl> vvl;
 
double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
 
#ifdef TESTING
  #define DEBUG fprintf(stderr,"====TESTING====\n")
  #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl
  #define debug(...) fprintf(stderr, __VA_ARGS__)
#else
  #define DEBUG 
  #define VALUE(x)
  #define debug(...)
#endif
 
#define FOR(a,b,c) for (int (a)=(b);(a)<(c);++(a))
#define FORN(a,b,c) for (int (a)=(b);(a)<=(c);++(a))
#define FORD(a,b,c) for (int (a)=(b);(a)>=(c);--(a))
#define FORSQ(a,b,c) for (int (a)=(b);(a)*(a)<=(c);++(a))
#define FORC(a,b,c) for (char (a)=(b);(a)<=(c);++(a))
#define FOREACH(a,b) for (auto &(a) : (b))
#define REP(i,n) FOR(i,0,n)
#define REPN(i,n) FORN(i,1,n)
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ALL(v) v.begin(),v.end()
#define ALLA(arr,sz) arr,arr+sz
#define SIZE(v) (int)v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr,sz) sort(ALLA(arr,sz))
#define REVERSEA(arr,sz) reverse(ALLA(arr,sz))
#define PERMUTE next_permutation
#define TC(t) while(t--)
 
inline string IntToString(LL a){
  char x[100];
  sprintf(x,"%lld",a); string s = x;
  return s;
}
 
inline LL StringToInt(string a){
  char x[100]; LL res;
  strcpy(x,a.c_str()); sscanf(x,"%lld",&res);
  return res;
}
 
inline string GetString(void){
  char x[1000005];
  scanf("%s",x); string s = x;
  return s;
}
 
inline string uppercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'a' && s[i] <= 'z') s[i] = s[i] - 'a' + 'A';
  return s;
}
 
inline string lowercase(string s){
  int n = SIZE(s); 
  REP(i,n) if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] - 'A' + 'a';
  return s;
}
 
inline void OPEN (string s) {
  #ifndef TESTING
  freopen ((s + ".in").c_str (), "r", stdin);
  freopen ((s + ".out").c_str (), "w", stdout);
  #endif
}

int n;
int A[100000];
int j, v;

void solve() {
  for (int i=0; i < n; i++){
    if (i != o){
      cout << " ";
    }
    cout << A[i] ;
  }
  cout << endl;
  for (int i = 1; i < n; i++){
    v = A[i];
    j = i - 1;
    while (j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;
    for (int k=0; k < n; k++){
      if (k != 0) cout << " ";
      cout << A[k];
    }
    if(i != n-1){
      cout << endl;
    }
  }
}

int main() {
  cin >> n ;
  REP(i, n) {
    cin >> A[i];
  }

  solve();

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:100:14: error: 'o' was not declared in this scope
  100 |     if (i != o){
      |              ^
Language: C++

#include<iostream>

int main() {
    int arr[1000], num, i, j, k, v;
    cin>>num;
    for (i = 0; i < num; i++) {
        cin>>arr[i];
    }
    for (i = 1; i < num; i++)
        for (k = 0; k < num; k++) {
            cout<<arr[k]<<" ";
        }
        v = arr[i];
        j = i - 1;
        while (j >= 0 && v < arr[j]) {
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = v;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>num;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |             cout<<arr[k]<<" ";
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: At global scope:
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
    int arr[1000], num, i, j, k, v;
    cin>>num;
    for (i = 0; i < num; i++) {
        cin>>arr[i];
    }
    for (i = 1; i < num; i++)
        for (k = 0; k < num; k++) {
            cout<<arr[k]<<" ";
        }
        v = arr[i];
        j = i - 1;
        while (j >= 0 && v < arr[j]) {
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = v;
    }
    return 0;
}

Compiler output:
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

include "bits/stdc++.h"

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (auto& a : A)
    cin >> a;
  
  cout << A[0];
  for (int p = 1; p < n; ++p)
    cout << " " << A[p];
  cout << endl;

  for (int i = 1; i < n; ++i) {
    int key = A[i];
    int j = i - 1;
    while (j >= 0 && A[j] > key) {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = key;
    cout << A[0];
    for (int p = 1; p < n; ++p)
      cout << " " << A[p];
    cout << endl;
  }
  
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include "bits/stdc++.h"
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n;
      |   ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> A(n);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> A(n);
      |          ^~~
a.cc:9:18: error: 'A' was not declared in this scope
    9 |   for (auto& a : A)
      |                  ^
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout << A[0];
      |   ^~~~
a.cc:12:11: error: 'A' was not declared in this scope
   12 |   cout << A[0];
      |           ^
a.cc:15:11: error: 'endl' was not declared in this scope
   15 |   cout << endl;
      |           ^~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;

#define MAXBOXNUM 1000

int main()
{
	int num;
	int box[MAXCOUNT]
	int i,j;
	
	cin >> num;
	
	for(i=0; i < num; i++)
	{
		cin >> box[i];
	}
	
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
	
	for(i=1; i < num; i++)
	{
		tmp = box[i];
		j = i;
		
		while(j >= 0 && box[j-1] > box[tmp])
		{
			box[j] = box[j-1];
			j--;
		}
		box[j] = tmp;
		
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
		
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'MAXCOUNT' was not declared in this scope
   10 |         int box[MAXCOUNT]
      |                 ^~~~~~~~
a.cc:11:9: error: expected initializer before 'int'
   11 |         int i,j;
      |         ^~~
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i=0; i < num; i++)
      |             ^
a.cc:17:24: error: 'box' was not declared in this scope
   17 |                 cin >> box[i];
      |                        ^~~
a.cc:20:13: error: 'i' was not declared in this scope
   20 |         for(i=0; i < num; i++)
      |             ^
a.cc:22:25: error: 'box' was not declared in this scope
   22 |                 cout << box[i];
      |                         ^~~
a.cc:29:13: error: 'i' was not declared in this scope
   29 |         for(i=1; i < num; i++)
      |             ^
a.cc:31:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   31 |                 tmp = box[i];
      |                 ^~~
      |                 tm
a.cc:31:23: error: 'box' was not declared in this scope
   31 |                 tmp = box[i];
      |                       ^~~
a.cc:32:17: error: 'j' was not declared in this scope
   32 |                 j = i;
      |                 ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;

#define MAXBOXNUM 1000

int main()
{
	int num;
	int box[MAXBOXNUM]
	int i,j;
	
	cin >> num;
	
	for(i=0; i < num; i++)
	{
		cin >> box[i];
	}
	
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
	
	for(i=1; i < num; i++)
	{
		tmp = box[i];
		j = i;
		
		while(j >= 0 && box[j-1] > box[tmp])
		{
			box[j] = box[j-1];
			j--;
		}
		box[j] = tmp;
		
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
		
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before 'int'
   11 |         int i,j;
      |         ^~~
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i=0; i < num; i++)
      |             ^
a.cc:17:24: error: 'box' was not declared in this scope
   17 |                 cin >> box[i];
      |                        ^~~
a.cc:20:13: error: 'i' was not declared in this scope
   20 |         for(i=0; i < num; i++)
      |             ^
a.cc:22:25: error: 'box' was not declared in this scope
   22 |                 cout << box[i];
      |                         ^~~
a.cc:29:13: error: 'i' was not declared in this scope
   29 |         for(i=1; i < num; i++)
      |             ^
a.cc:31:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   31 |                 tmp = box[i];
      |                 ^~~
      |                 tm
a.cc:31:23: error: 'box' was not declared in this scope
   31 |                 tmp = box[i];
      |                       ^~~
a.cc:32:17: error: 'j' was not declared in this scope
   32 |                 j = i;
      |                 ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;

#define MAXBOXNUM 1000

int main()
{
	int num;
	int box[MAXBOXNUM];
	int i,j;
	
	cin >> num;
	
	for(i=0; i < num; i++)
	{
		cin >> box[i];
	}
	
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
	
	for(i=1; i < num; i++)
	{
		tmp = box[i];
		j = i;
		
		while(j >= 0 && box[j-1] > box[tmp])
		{
			box[j] = box[j-1];
			j--;
		}
		box[j] = tmp;
		
	for(i=0; i < num; i++)
	{
		cout << box[i];
		if(!(i == num-1))
		{
			cout << " ";
		}
	}
		
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   31 |                 tmp = box[i];
      |                 ^~~
      |                 tm