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

#include<stdio.h>

void insertionSort(int a[1000], int N);

int main(void){
    int a[1000],N,i,j;
    scanf("%d",&N);
    
    for(i=0;i<N;i++){
        scanf("%d ",a[k]);
    }

    insertionSort(a,N);

}

void insertionSort(int a[1000], int N){
    int i,j,k.v;

    for(k=0;k<N;k++){
        printf("%d ",&a[k]);
    }
    printf("\n");
 

    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;
        for(k=0;k<N;k++){
            printf("%d ",&a[k]);
        }
        printf("\n");
    }    
}
}


Compiler output:
main.c: In function 'main':
main.c:10:23: error: 'k' undeclared (first use in this function)
   10 |         scanf("%d ",a[k]);
      |                       ^
main.c:10:23: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insertionSort':
main.c:18:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   18 |     int i,j,k.v;
      |              ^
main.c:20:9: error: 'k' undeclared (first use in this function)
   20 |     for(k=0;k<N;k++){
      |         ^
main.c:27:9: error: 'v' undeclared (first use in this function)
   27 |         v=a[i];
      |         ^
main.c: At top level:
main.c:40:1: error: expected identifier or '(' before '}' token
   40 | }
      | ^
Language: C

#include<stdio.h>

void insertionSort(int a[1000], int N);

int main(void){
    int a[1000],N,i,j;
    scanf("%d",&N);
    
    for(i=0;i<N;i++){
        scanf("%d ",a[i]);
    }

    insertionSort(a,N);

}

void insertionSort(int a[1000], int N){
    int i,j,k.v;

    for(k=0;k<N;k++){
        printf("%d ",&a[k]);
    }
    printf("\n");
 

    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;
        for(k=0;k<N;k++){
            printf("%d ",a[k]);
        }
        printf("\n");
    }    
}



Compiler output:
main.c: In function 'insertionSort':
main.c:18:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   18 |     int i,j,k.v;
      |              ^
main.c:20:9: error: 'k' undeclared (first use in this function)
   20 |     for(k=0;k<N;k++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:9: error: 'v' undeclared (first use in this function)
   27 |         v=a[i];
      |         ^
Language: C

#include<stdio.h>

void insertionSort(int a[1000], int N);

int main(void){
    int a[1000],N,i,j;
    scanf("%d",&N);
    
    for(i=0;i<N;i++){
        scanf("%d ",&a[i]);
    }

    insertionSort(a,N);

}

void insertionSort(int a[1000], int N){
    int i,j,k.v;

    for(k=0;k<N;k++){
        printf("%d ",a[k]);
    }
    printf("\n");
 

    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;
        for(k=0;k<N;k++){
            printf("%d ",a[k]);
        }
        printf("\n");
    }    
}



Compiler output:
main.c: In function 'insertionSort':
main.c:18:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   18 |     int i,j,k.v;
      |              ^
main.c:20:9: error: 'k' undeclared (first use in this function)
   20 |     for(k=0;k<N;k++){
      |         ^
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:9: error: 'v' undeclared (first use in this function)
   27 |         v=a[i];
      |         ^
Language: C

#include<stdio.h>

void insertionSort(int a[1000], int N);

int main(void){
    int a[1000],N,i,j;
    scanf("%d",&N);
    
    for(i=0;i<N;i++){
        scanf("%d ",&a[i]);
    }

    insertionSort(a,N);

}

void insertionSort(int a[1000], int N){
    int i,j,k,v;

    printf("%d",a[0]);
    for(k=1;k<N;k++){
        printf(" %d",a[k]);
    }
    printf("\n")
 

    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;

        printf("%d",a[0]);
        for(k=1;k<N;k++){
            printf(" %d",a[k]);
        }
        printf("\n")
    }
        
}



Compiler output:
main.c: In function 'insertionSort':
main.c:24:17: error: expected ';' before 'for'
   24 |     printf("\n")
      |                 ^
      |                 ;
......
   27 |     for(i=1;i<N;i++){
      |     ~~~
Language: C

#include<stdio.h>
using namespace std;

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[j + i] = 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]);

    insertionSort(A,N);

    return 0;
}


Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
Language: C

#include<stdio.h>

int main(void){
    int N;
    int A[1000];
    int i,j;
    int v;
    
    scanf("%d", &N);
    for(I=0;i<N;i++){
        scanf("%d", A[i]);
    }
    
    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;
        
        for(i=0;i<N;i++){
            printf("%d ", A[i]);
        }
        putchar('\n');
    }
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'I' undeclared (first use in this function)
   10 |     for(I=0;i<N;i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
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 i, j;
	int v;

	for (i = 0; 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[1000];
	int i;

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

	
	insertionSort(A, N);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:35:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   35 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>

int main(void){

 int a, N, A[1000], i, v, j;

 scanf("%d", &N);

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

 for(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;
  for(i = 0; i<N-1; i++)
   printf("%d ", A[i]);
  printf("%d\n", A[N]);
 }

 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:17: error: 'n' undeclared (first use in this function)
   14 |  for(i = 1; i < n-1; i++){
      |                 ^
main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){

 int N, A[1000], i, v, j;

 scanf("%d", &N);

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

 for(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;
  for(i = 0; i<N-1; i++)
   printf("%d ", A[i]);
  printf("%d\n", A[N]);
 }

 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:17: error: 'n' undeclared (first use in this function)
   12 |  for(i = 1; i < n-1; i++){
      |                 ^
main.c:12:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C


#include <stdio.h>

int main(void){

 int N, A[1000], i, v, j;

 scanf("%d", &N);

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

 for(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;
  for(i = 0; i<N-1; i++)
   printf("%d ", A[i]);
  printf("%d\n", A[N-1]);
 }

 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:17: error: 'n' undeclared (first use in this function)
   13 |  for(i = 1; i < n-1; i++){
      |                 ^
main.c:13:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void)
{
	int a, k, i, j, n, x, card[110] = {};

	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf_s("%d", &card[i]);
	}

	for (i = 0; i < n; i++) {
		x = i;
		for (j = i; j < n; j++) {
			if (card[x] > card[j])
				x = j;
		}
		a = card[x]; card[x] = card[i]; card[i] = a;

		for (k = 0; k < n; k++) {
			printf("%d", card[k]);
			if (k != n - 1)
				printf(" ");
			else
				printf("\n");
		}
	}
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>

void sort(int,int[]);

int main(void)
{
	int i, n, card_a[110] = {};

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &card_a[i]);
	}
    
    sort(n,card_a);

	return 0;
}

void sort(int num,int card[])
{
    int i, v, j, k;
	for (i = 0; i < num; i++) {
	    if(i!=o){
	        v=card[i];
	        j=i-1;
	        while(j>=0 && card[j]>=v){
	            card[j+1]=card[j];
	            j--;
	            card[j+1]=v;
	        }
        }
		for (k = 0; k < num; k++) {
			printf("%d", card[k]);
			if (k != num - 1)
				printf(" ");
			else
				printf("\n");
		}
	}
}


Compiler output:
main.c: In function 'sort':
main.c:23:19: error: 'o' undeclared (first use in this function)
   23 |             if(i!=o){
      |                   ^
main.c:23:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
    int N;
    int A[2000];
    int i, j, k ,v;

    scanf("%d", &N);

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

    for(i=1; i<N; i++){
        v = A[i];
        j = i - 1;
        while(j >= 0 && A[j] > v){
            A[j+1] = A[j];
            j = j - 1;
        }
        A[j+1] = v;
        for(k=0; k<N; k++){
            if(_Has_lock_kind_>0){
                printf(" ");
            }
            printf("%d", A[k]);
        }
        printf("\n");
    }

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:16: error: '_Has_lock_kind_' undeclared (first use in this function)
   28 |             if(_Has_lock_kind_>0){
      |                ^~~~~~~~~~~~~~~
main.c:28:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <iostream>
using namespace std;

int main(){

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

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:12:23: error: 'A' undeclared (first use in this function)
   12 |                 key = A[i];
      |                       ^
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:29: error: expected ';' before 'for'
   18 |                 A[j+1] = key
      |                             ^
      |                             ;
   19 |                 for(i=0; i<n; i++){
      |                 ~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:18:17: error: 'A' undeclared (first use in this function)
   18 |                 A[j+1] = key;
      |                 ^
main.c:18:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int n;
	scanf("%d",&n);
	int i,j;
	int temp;
	int data[n];
	for(i=0;i<n;i++){
		scanf("%d",&data[i]);
	}
	for(i=0;i<n;i++){
		temp=data[i];
		j=i;
		while(j>0&&data[j-1]>temp){
			data[j]=data[j-1];
			j--;
		}
		data[j]=temp;
		j=0;
		whle(j<n){
			if(j+1==n){
				printf("%d",data[j]);
				continue;
			}
			printf("%d ",data[j]);
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:17: error: implicit declaration of function 'whle' [-Wimplicit-function-declaration]
   20 |                 whle(j<n){
      |                 ^~~~
main.c:20:26: error: expected ';' before '{' token
   20 |                 whle(j<n){
      |                          ^
      |                          ;
Language: C

#include <stdio.h>

int main(void){
    int n,a[101],i,j,key,k;
    scanf("%d",&n);
    for (i=0; i<n; i++)
        scanf("%d",&a[i]);

    printf("\n");
    for (i=1; i<n; i++) {
        key=a[i];
        j=i-1;
        while(j>=0&&a[j]>key){
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=key;
        for (k=0; k<n; k++){
            printf("%d",a[k]);
            if(k==n-1)
                break;
            printf(" ");
        }
        printf("\n");
    }

Compiler output:
main.c: In function 'main':
main.c:25:5: error: expected declaration or statement at end of input
   25 |     }
      |     ^
Language: C

#include<stdio.h>
#define NUM 100

void insertionSort(int A[], int N){
  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;
    }
    for(k = 0; k < N; k++){
      printf("%d", A[k]);
    }
    printf("\n");
  }
}

int main(void){
  int array[NUM];
  int num;
  int i;

  scanf("%d", &num);
  for(i = 0; i < num; i++){
    scanf("%d", &array[i]);
  }

  for(i = 0; i < num; i++){
    printf("%d", array[i]);
  }
  printf("\n");
  
  insertionSort(array, num);

  return 0;
}

Compiler output:
main.c: In function 'insertionSort':
main.c:5:7: error: 'i' undeclared (first use in this function)
    5 |   for(i = 1; i < N; i++){
      |       ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:5: error: 'v' undeclared (first use in this function)
    6 |     v = A[i];
      |     ^
main.c:7:5: error: 'j' undeclared (first use in this function)
    7 |     j = i - 1;
      |     ^
main.c:13:9: error: 'k' undeclared (first use in this function)
   13 |     for(k = 0; k < N; k++){
      |         ^
Language: C

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

vector<int> viSort;
int iMaxSize;

void fnTrace()
{
  for (int i = 0; i < iMaxSize; i++)
  {
    if (i) cout << " ";
    cout << viSort[i];
  }
  cout << endl;
}

void insertionSort()
{
  for (int i = 1; i < iMaxSize; i++)
  {
    int iTarget = viSort[i];
    int j = i - 1;
    while (iTarget < viSort[j] &&
           j       >= 0            )
    {
      viSort[j + 1] = viSort[j];
      j--;
    }
    viSort[j + 1] = iTarget;
    fnTrace();
  }
}

int main()
{
  cin >> iMaxSize;
  viSort.resize( iMaxSize );
  for (int i = 0; i < iMaxSize; i++) cin >> viSort[i];

  fnTrace();
  insertionSort();

  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
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, key;
  int A[N+1];
  scanf("%d", &n);

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

Compiler output:
main.c: In function 'main':
main.c:33:3: error: expected declaration or statement at end of input
   33 |   return 0;
      |   ^~~~~~
Language: C

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

Compiler output:
main.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | int main{
      |         ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:25: warning: missing terminating " character
    6 | for(i=0;i<n+1;i++)scanf("%d,&A[i]);
      |                         ^
main.c:6:25: error: missing terminating " character
    6 | for(i=0;i<n+1;i++)scanf("%d,&A[i]);
      |                         ^~~~~~~~~~~
main.c:7:1: error: expected expression before 'for'
    7 | for(i=1;i<n+1;i++){
      | ^~~
main.c:17:10: error: expected ';' before '}' token
   17 | return 0;
      |          ^
      |          ;
   18 | }
      | ~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:25: warning: missing terminating " character
    6 | for(i=0;i<n+1;i++)scanf("%d,&A[i]);
      |                         ^
main.c:6:25: error: missing terminating " character
    6 | for(i=0;i<n+1;i++)scanf("%d,&A[i]);
      |                         ^~~~~~~~~~~
main.c:7:1: error: expected expression before 'for'
    7 | for(i=1;i<n+1;i++){
      | ^~~
main.c:17:10: error: expected ';' before '}' token
   17 | return 0;
      |          ^
      |          ;
   18 | }
      | ~
Language: C

scanf (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])

for i = 1 to A.length-1
    key = A[i]
    /* insert A[i] into the sorted sequence A[0,...,j-1] */
    j = i - 1
    while j >= 0 and A[j] > key
        A[j+1] = A[j]
        j--
    A[j+1] = key
    for k = 0 to 5
    pirntf A[k]

Compiler output:
main.c:1:8: error: expected declaration specifiers or '...' before '%' token
    1 | scanf (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])
      |        ^
main.c:1:24: error: expected declaration specifiers or '...' before '&' token
    1 | scanf (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])
      |                        ^
Language: C


scan (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])

for i = 1 to A.length-1
    key = A[i]
    /* insert A[i] into the sorted sequence A[0,...,j-1] */
    j = i - 1
    while j >= 0 and A[j] > key
        A[j+1] = A[j]
        j--
    A[j+1] = key
    for k = 0 to 5
    pirnt A[k]
    

Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before '%' token
    2 | scan (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])
      |       ^
main.c:2:23: error: expected declaration specifiers or '...' before '&' token
    2 | scan (%d%d%d%d%d%d%d, &A[0] &A[1] &A[2] &A[3] &A[4] &A[5] &A[6])
      |                       ^
Language: C

#include<stdio.h>

int main(){

  int i,j,n,min,g;
  int A[100];
  
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);
  
  for(i=1;i<n+1;i++){
    min = A[i];
    j = i-1;
     for(g=0;g<n;g++){
      printf("%d ",A[g]);
    }
    if(i<n)prinf("\n");
    while(j >= 0 && A[j] > min){
      A[j+1] = A[j];
      j--;
      A[j+1] = min;
    }
   
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:12: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |     if(i<n)prinf("\n");
      |            ^~~~~
      |            printf
Language: C

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

int main(){
  char *a;
  int n, v, i, j, k;

  scanf("%d", &n);
  a = (char *)malloc(n);
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
    printf("%d ", a[i]);
  }
  printf("\n");
  for(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;
    }
    for(k = 0; k < n; k++) printf("%d ", a[k]);
    printf("\n");
  }
  free(a);
  return 0;
}
stdrsv1121{s1220049}55:	

Compiler output:
main.c:29:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   29 | stdrsv1121{s1220049}55:
      |           ^
main.c:29:21: error: expected identifier or '(' before numeric constant
   29 | stdrsv1121{s1220049}55:
      |                     ^~
Language: C


#include<stdio.h>

main()
{
  int A[7];
  int i,k;

  scanf("%d",&A[6])
for k = 0 to A.length-1
	  scanf("%d",&A[k])
for i = 1 to A.length-1
    key = A[i]
    /* insert A[i] into the sorted sequence A[0,...,j-1] */
    j = i - 1
    while j >= 0 and A[j] > key
        A[j+1] = A[j]
        j--
    A[j+1] = key
for k = 0 to 5
    pirntf ("%d",A[k])

	  return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main()
      | ^~~~
main.c: In function 'main':
main.c:9:20: error: expected ';' before 'for'
    9 |   scanf("%d",&A[6])
      |                    ^
      |                    ;
   10 | for k = 0 to A.length-1
      | ~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define A 1000

int main(void){
  int n,i,temp,j,k;
  int a[N];

  scanf("%d",&n);
  if(n<0||n>N)exit(1);  
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(k=0;k<n;k++){
    if(k!=n-1) printf("%d ",a[k]);
    else printf("%d\n",a[k]);
  }
  for(j=1;j<n;j++){
    temp=a[j];
    i=j-1;
    while(i>=0 && a[i] > temp){
      a[i+1]=a[i];
      i=i-1;
    }
    a[i+1]=temp;
    for(k=0;k<n;k++){
      if(k!=n-1) printf("%d ",a[k]);
      else printf("%d\n",a[k]);
    }
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:32:3: error: expected declaration or statement at end of input
   32 |   }
      |   ^
Language: C

#include<stdio.h>

int main(){
  int a[100],n,i,j,k,key;
  while(1){
    scanf("%d",&n);
    if(n >= 1 && n <= 100) break;
  }
  while( 1 ){
    j = 0;
    for(i = 0;i < n;i++){
      scanf("%d",&a[i]);
      if(a[i] < 0 || a[i] > 1000) j = 1;
    }
    if(j == 0) break;
  }
  for(i = 1;i < n;i++){
 
    key = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > key){
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = key;
    for(k = 0;k < n;k++){
      if(k == n-1) printf("%d\n",a[k]);
      else printf("%d ",a[k]);
    }
  }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:31:3: error: expected declaration or statement at end of input
   31 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>

int main(){
  int a[100],n,i,j,k,key;
  while(1){
    scanf("%d",&n);
    if(n >= 1 && n <= 100) break;
  }
  while( 1 ){
    j = 0;
    for(i = 0;i < n;i++){
      scanf("%d",&a[i]);
      if(a[i] < 0 || a[i] > 1000) j = 1;
    }
    if(j == 0) break;
  }
  for(i = 1;i < n;i++){
 
    key = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > key){
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = key;

Compiler output:
main.c: In function 'main':
main.c:25:5: error: expected declaration or statement at end of input
   25 |     a[j+1] = key;
      |     ^
main.c:25:5: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
main()
{
  int i,j,v,n,a[1000];
  scanf("%d",&n);
  for(i=0; i<n; i++){
  scanf("%d",&a[i]);
  }
  for(i=0; 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;
    }
    for(j=0; j<n; j++){
    printf("%d",a[j]);
    if(a[j+1] == '\0')printf(" ");
    else printf("\n")
    }
  }
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:20:22: error: expected ';' before '}' token
   20 |     else printf("\n")
      |                      ^
      |                      ;
   21 |     }
      |     ~
Language: C

#include <stdio.h>

main(){
  int i,j,k,n,a[A];

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

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:17: error: 'A' undeclared (first use in this function)
    4 |   int i,j,k,n,a[A];
      |                 ^
main.c:4:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
main(){
  int i,j,k,n,a[A];

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

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

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:17: error: 'A' undeclared (first use in this function)
    3 |   int i,j,k,n,a[A];
      |                 ^
main.c:3:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
main(){
  int i,j,k,n,a[A];

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

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

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:17: error: 'A' undeclared (first use in this function)
    3 |   int i,j,k,n,a[A];
      |                 ^
main.c:3:17: note: each undeclared identifier is reported only once for each function it appears in
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 i,j,k;
  for(i = 1 ; i < N ; i++)
    {
      k = a[i];
      j = i - 1;
      while( j >= 0 && a[j] > k)
	{
	  a[j + 1] = k;
	  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);

    return 0;
  }

Compiler output:
main.c: In function 'InsertionSort':
main.c:24:17: error: 'A' undeclared (first use in this function)
   24 |           trace(A,N);
      |                 ^
main.c:24:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:39:3: error: expected declaration or statement at end of input
   39 |   }
      |   ^
Language: C

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:2: error: stray '\343' in program
    8 |  <U+3000>j=i;
      |  ^~~~~~~~
main.c:18:1: error: stray '\343' in program
   18 | <U+3000>return 0;
      | ^~~~~~~~
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 i,j,k;
  for(i = 1 ; i < N ; i++)
    {
      k = a[i];
      j = i - 1;
      while( j >= 0 && a[j] > k)
	{
	  a[j + 1] = k;
	  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:
main.c: In function 'InsertionSort':
main.c:24:17: error: 'A' undeclared (first use in this function)
   24 |           trace(A,N);
      |                 ^
main.c:24:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:3: error: expected declaration or statement at end of input
   40 |   }
      |   ^
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 i,j,k;
  for(i = 1 ; i < N ; i++)
    {
      k = a[i];
      j = i - 1;
      while( j >= 0 && A[j] > k)
	{
	  a[j + 1] = k;
	  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:
main.c: In function 'InsertionSort':
main.c:21:24: error: 'A' undeclared (first use in this function)
   21 |       while( j >= 0 && A[j] > k)
      |                        ^
main.c:21:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:3: error: expected declaration or statement at end of input
   40 |   }
      |   ^
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 i,j,k;
  for(i = 1 ; i < N ; i++)
    {
      k = A[i];
      j = i - 1;
      while( j >= 0 && A[j] > k)
	{
	  A[j + 1] = k;
	  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:
main.c: In function 'InsertionSort':
main.c:40:3: error: expected declaration or statement at end of input
   40 |   }
      |   ^
Language: C

#include <stdio.h>
#define A 1000 

main(){
 int i,j,k,n,a[A];
 scanf("%d",&n);
 for(i=0;i<n;i++)scanf("%d",&a[i]);
 for(i=0;i<n;i++){
  j=i;
  while(j>0 && a[j]<a[j-1]){
   k=a[j-1];
   a[j-1]=a[j];
   a[j]=k;
   j--;
  }
  for(j=0;j<n;j++){
    printf("%d",a[j]);
    if(j!=n-1)printf(" ");
    printf("\n");
 }
 return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
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 i,j,k;
  for(i = 1 ; i < N ; i++)
    {
      k = A[i];
      j = i - 1;
      while( j >= 0 && A[j] > k)
	{
	  A[j + 1] = A[j];
	  j--;
	}
	  A[j + 1] = k;
	  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:
main.c: In function 'main':
main.c:40:3: error: implicit declaration of function 'InsertionSort'; did you mean 'insertionSort'? [-Wimplicit-function-declaration]
   40 |   InsertionSort(A,N);
      |   ^~~~~~~~~~~~~
      |   insertionSort
Language: C

#include<stdio.h>

void trace(int A[], int N){
  int i;
  for( i = 0; i <; 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[j + 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:
main.c: In function 'trace':
main.c:5:18: error: expected expression before ';' token
    5 |   for( i = 0; i <; i++ ){
      |                  ^
main.c:6:25: error: expected ';' before 'printf'
    6 |     if(i > 0)printf(" ")
      |                         ^
      |                         ;
    7 |                printf("%d",A[i]);
      |                ~~~~~~
Language: C

#include<stdio.h>

void trace(int A[], int N){
  int i;
  for( i = 0; i <; 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[j + 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:
main.c: In function 'trace':
main.c:5:18: error: expected expression before ';' token
    5 |   for( i = 0; i <; i++ ){
      |                  ^
Language: C

#include <stdio.h>
#define W 1000

int main(){
  int A[W];
  int i,j,v,N;
  
  scanf("%d\n",&N);
 

    else{
      for(i = 0; i < N; i++){
	scanf("%d",&A[i]);
      }
    }
  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;
    }
    for(j = 0; j < N; j++){
      printf("%d",A[j]);
      if(j != N-1)
	printf(" ");
      else printf ("\n");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:5: error: 'else' without a previous 'if'
   11 |     else{
      |     ^~~~
Language: C

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:11:25: error: 'a' undeclared (first use in this function)
   11 |       else printf("%d ",a[i]);
      |                         ^
main.c:11:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

main(){
  
  int A[100],N,i,j,v;
  
  scanf("%d",&N);
  for(i=0 ; i<N ; i++){
    scanf("%d",&A[i]);
    printf("%d ",A[i]);
  }

    printf("\n");

  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;

    for( v=0 ; v<N ; v++){
      printf("%d",A[v]);
      if(v<N-1)printf(" ");
    }
          printf("\n");

  } 
  return 0

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:32:11: error: expected ';' at end of input
   32 |   return 0
      |           ^
      |           ;
main.c:32:3: error: expected declaration or statement at end of input
   32 |   return 0
      |   ^~~~~~
Language: C

#include <stdio.h>

main(){
  
  int A[100],N,i,j,v;
  
  scanf("%d",&N);
  for(i=0 ; i<N ; i++){
    scanf("%d",&A[i]);
    printf("%d ",A[i]);
  }

    printf("\n");

  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;

    for( v=0 ; v<N ; v++){
      printf("%d",A[v]);
      if(v<N-1)printf(" ");
    }
          printf("\n");

  } 
  return 0
｝

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:32:11: error: expected ';' before '\U0000ff5d'
   32 |   return 0
      |           ^
      |           ;
   33 | ｝
      | ~~         
main.c:33:1: error: expected declaration or statement at end of input
   33 | ｝
      | ^~
Language: C

#include <stdio.h>

#define ARRAY_MAX 101												/* ??°???????????§????´???° */
#define ZERO 0														/* 0??????????????? */
#define ONE 1														/* 1??????????????? */

void view_array( void );

unsigned short usG_Darray[ ARRAY_MAX ];								/* ?????????????±???°??? */
unsigned char ubG_Dcount;											/* ????´???° */

int main( void )
{
	unsigned char ubW_Ci;											/* ????????????i */
	unsigned char ubW_Cj;											/* ????????????j */
	unsigned short usW_Dtrade;										/* ???????????¨?????° */

	scanf("%d", &ubG_Dcount);										/* ????´???°???????????? */
	/* ??°?????????????????¨????????? */
	for( ubW_Ci = ZERO; ubW_Ci < ubG_Dcount; ubW_Ci++){
		scanf("%d", &usG_Darray[ ubW_Ci ]);							/* ??°??????????????? */
	}

	/* ?????\???????????¨????????? */
	for( ubW_Ci = ONE; ubW_Ci < ubG_Dcount; ubW_Ci++){
		view_array();														/* ??????????????¨??? */
		usW_Dtrade = usG_Darray[ ubW_Ci ];							/* ???????????¨?????°????????????????±???????????????? */
		ubW_Cj = ubW_Ci;											/* ?????\?????????????????? */
		/* ????????????j???0??\?????????????????????????±???????[ j-1 ]??????????????¨?????°????????§????????´???????????? */
		while( ( ubW_Cj > ZERO ) && ( usG_Darray[ ubW_Cj - ONE ] > usW_Dtrade ) ){
			usG_Darray[ ubW_Cj ] = usG_Darray[ ubW_Cj - ONE ];		/* ?????????????±???????[ j ]????????????????±???????[ j - 1 ]???????????? */
			ubW_Cj--;												/* ????????????j????????????????????? */
		}
		usG_Darray[ ubW_Cj ] = usW_Dtrade;							/* ?????????????±???????[ j ]??????????????¨?????°???????????? */
	}

	view_array();															/* ?????????????????¨??? */
	return ZERO;
}

static void view_array( void )
{
	unsigned char ubW_Cvi;											/* view???????????????????????????i */
	unsigned char ubW_Cvj;											/* view???????????????????????????j */

	/* ??°?????¨?????¨????????? */
	for( ubW_Cvi = ZERO; ubW_Cvi < ubG_Dcount; ubW_Cvi++){
		/* ??°???????????????????´??????´??? */
		if( ubW_Cvi == ubG_Dcount - ONE ){
			printf("%d\n", usG_Darray[ ubW_Cvi ]);					/* ??°?????¨???????????? */
		}
		else{
			printf("%d ", usG_Darray[ ubW_Cvi ]);					/* ??°?????¨??? */
		}
	}
}

Compiler output:
main.c:41:13: error: static declaration of 'view_array' follows non-static declaration
   41 | static void view_array( void )
      |             ^~~~~~~~~~
main.c:7:6: note: previous declaration of 'view_array' with type 'void(void)'
    7 | void view_array( void );
      |      ^~~~~~~~~~
Language: C

include<stdio.h>

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

    int N, i, y;

  scanf("%d",&N);

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

    printf("%d ",A[i]);
  }
  printf("\n");


  insertionSort(A, N);


}

void insertionSort(int A[], int N){
  int i, j, k, 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;
    }

    for(k = 0;k < N; k++){
      printf("%d ",A[k]);
    }
    printf("\n");
  }
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |   scanf("%d",&N);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:9:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |   scanf("%d",&N);
      |   ^~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |     printf("%d ",A[i]);
      |     ^~~~~~
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |   printf("\n");
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:3: error: implicit declaration of function 'insertionSort' [-Wimplicit-function-declaration]
   20 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
main.c: At top level:
main.c:25:6: warning: conflicting types for 'insertionSort'; have 'void(int *, int)'
   25 | void insertionSort(int A[], int N){
      |      ^~~~~~~~~~~~~
main.c:20:3: note: previous implicit declaration of 'insertionSort' with type 'void(int *, int)'
   20 |   insertionSort(A, N);
      |   ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:39:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   39 |       printf("%d ",A[k]);
      |       ^~~~~~
main.c:39:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:41:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   41 |     printf("\n");
      |     ^~~~~~
main.c:41:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

int N,A[100],i,j,k;

void d(){
    int x;
    for(x=0;x<N;x++){
        printf("%d%s",A[x],x==N-1 ? "\n" : " ");
    }

int main(void){
    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&A[i]);
    for(i=1;i<N;A[j+1]=k,i++){
        for(k=A[i],j=i-1,d();A[j]>k;j--){
            A[j+1]=A[j];
            }
        }
    d();
    return 0;
}

Compiler output:
main.c: In function 'd':
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
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 key;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
  
  trace(A, n);

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


  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:10: error: expected ';' before '}' token
   29 |       j--
      |          ^
      |          ;
   30 |     }
      |     ~
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 key;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
  
  trace(A, n);

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

    trace(A ,n)

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:33:16: error: expected ';' before '}' token
   33 |     trace(A ,n)
      |                ^
      |                ;
   34 | 
   35 |   }
      |   ~
Language: C

#include<stdio.h>
using namespace std;
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[j + 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:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
Language: C

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

void func_dsp(int *s_p,int n)
{
	int i;
	for (i=0 ; i<n ; i++) {
		if (i == n-1) {
			printf("%d\n",s_p[i]);
		}
		else {
			printf("%d ",s_p[i]);
		}
	}
}

int func(int *s_p,int n)
{
	int v;
	int i,j;
	int flg=0;

	for (i=1 ; i<n ; i++) {
		v = s_p[i];
		j = i - 1;

		while((j>=0) && (s_p[j]>v)) {
			s_p[j+1] = s_p[j];
			j--;
			flg++;
		}
		s_p[j+1] = v;
		if (flg!=0) break;
	}
	return flg;
}
int main()
{
	int	   n;
	int	   s[1000];
	int	   i;
	int    rtn;
	char   inp[128];
	char   *p;
	char   *wk;

	while(1) {
		gets(inp);
		sscanf(inp,"%d",&n);
		if (n == 0)
			return 0;
		gets_s(inp);
		p = strtok(inp, " ");
		for (i=0 ; p!=NULL ; i++) {
			sscanf(p,"%d",&(s[i]));
			p = strtok(NULL, " ");
		}
		/*--- CALC ---*/
		i = 0;
		while(1) {
			if (i < n) {
				func_dsp(s,n);
			}
			else {
				break;
			}
			rtn = func(s,n);
			if (rtn == 0) {
//				break;
			}
			i++;
		}
		break;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:51:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   51 |                 gets(inp);
      |                 ^~~~
      |                 fgets
main.c:55:17: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
   55 |                 gets_s(inp);
      |                 ^~~~~~