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

#include <stdio.h>

int main()
{
 int N;
 scanf("%d",&N);
 int A[N];
 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
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:6: error: expected '(' before 'i'
    8 |  for i = 1 to A.length-1
      |      ^
      |      (
main.c:8:6: error: 'i' undeclared (first use in this function)
main.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <conio.h>

int main()
{
 int n,a[100],i,j,dem=0,x;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
  scanf("%d",&a[i]);
 }
 for(i=0;i<n;i++)
 {
  for(j=0;j<n;j++)
  {
   printf("%d",a[j]);
  }
  dem++;
  for(int i=0;i<dem;i++)
  {
	  for(int j=i+1;j<=dem;j++)
	  {
		  if(a[i]>a[j])
		  {
			  x=a[i];
			  a[i]=a[j];
			  a[j]=x;
		  }
	  }
  }
  printf("\n");
 }
 getch();
 return 0;
}

Compiler output:
main.c:2:10: fatal error: conio.h: No such file or directory
    2 | #include <conio.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 insertSort(int A[], int N) {
	int value, j, i;
	for (i = 1; i < N - 1; i++) { 
		value = A[i];
		j = i - 1;
		while (j >= 0 && value <  A[j] ) {
			A[j + 1] = A[j];
			j--;
		}

           A[j + 1] = value;
           trace(A, N)
	}

}

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

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

	return 0;
}

Compiler output:
main.c: In function 'insertSort':
main.c:23:23: error: expected ';' before '}' token
   23 |            trace(A, N)
      |                       ^
      |                       ;
   24 |         }
      |         ~
Language: C

#include <stdio.h>      int main(void){     int n,x,i,j,k;     while(1){     int c=0;     scanf("%d %d",&n,&x);     if(n==0 && x==0){         break;     }     for(i=1;i<=n;i++){         for(j=i+1;j<=n;j++){             for(k=j+1;k<=n;k++){                 if(i+j+k==x){                     c++;                 }             }         }     }     printf("%d\n",c);     }     return 0; } 

Compiler output:
main.c:1:25: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>      int main(void){     int n,x,i,j,k;     while(1){     int c=0;     scanf("%d %d",&n,&x);     if(n==0 && x==0){         break;     }     for(i=1;i<=n;i++){         for(j=i+1;j<=n;j++){             for(k=j+1;k<=n;k++){                 if(i+j+k==x){                     c++;                 }             }         }     }     printf("%d\n",c);     }     return 0; }
      |                         ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

void trance(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;
intA[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 'trance':
main.c:5:5: error: expected expression before ')' token
    5 | for()i=0;i<N;i++){
      |     ^
main.c:5:5: error: expected expression before ')' token
main.c:5:17: error: expected ';' before ')' token
    5 | for()i=0;i<N;i++){
      |                 ^
      |                 ;
main.c:5:17: error: expected statement before ')' token
main.c: In function 'insertionSort':
main.c:17:15: error: 'a' undeclared (first use in this function)
   17 | while(j>=0 && a[j]>v){
      |               ^
main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:1: error: implicit declaration of function 'trace'; did you mean 'trance'? [-Wimplicit-function-declaration]
   22 | trace(A,N);
      | ^~~~~
      | trance
main.c: In function 'main':
main.c:28:1: error: 'intA' undeclared (first use in this function); did you mean 'int'?
   28 | intA[100];
      | ^~~~
      | int
main.c:31:29: error: 'A' undeclared (first use in this function)
   31 | for(i=0;i<N;i++)scanf("%d",&A[i]);
      |                             ^
main.c:36:1: error: expected declaration or statement at end of input
   36 | return 0;
      | ^~~~~~
Language: C

#include<iostream>
using namespace std;

int ssort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj]) minj=j;
    }
    t=A[i]; A[i]=A[minj]; A[minj]=t;
    if(i!=minj) sw++;
  }
  return sw;
}
int main(){
  int i,A[100],N,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++) cin>>A[i];
  sw=ssort(A,N);
  for(i=0;i<N;i++){
    if(i>0) cout<<(" ");
    cout<<A[i];
  }
  cout<<endl;
  cout<<sw<<endl;

  return 0;
}

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

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:8:41: error: expected ')' before ';' token
    8 | for(i=0;i<n-1;i++) scanf("%d ",&array[i];
      |                         ~               ^
      |                                         )
main.c:21:10: error: expected ';' before '}' token
   21 | return 0;
      |          ^
      |          ;
   22 | }
      | ~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:10:11: error: 'N' undeclared (first use in this function)
   10 | for(i=1;i<N;i++)
      |           ^
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:7: error: expected '(' before 'j'
   14 | while j>=0 && array[j]>v
      |       ^
      |       (
Language: C

#include<stdio.h>

int main(void)
{
int n,i,j,v;
scanf("%d\n",&n);
int array[n];
for(i=0;i<n-1;i++) scanf("%d ",&array[i]);
scanf("%d",&array[n-1]);
for(i=1;i<n;i++)
{
v=array[i];
j=i-1;
while j>=0 && array[j]>v
{
array[j+1]=array[j];
j--;
}
array[j+1]=v;
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:7: error: expected '(' before 'j'
   14 | while j>=0 && array[j]>v
      |       ^
      |       (
Language: C

#include <stdio.h>
#define N 101

int main(){

  int i,j,k,m,n;
  int A[N];

  scanf("%d",&n);

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

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

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

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

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:13:7: error: expected '(' before 'j'
   13 | while j>=0 && array[j]>v
      |       ^
      |       (
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 inssort(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);
	inssort(A, N);

	return 0;
}

Compiler output:
main.c: In function 'trace':
main.c:8:35: error: expected ';' before '}' token
    8 |                 printf("%d", A[i])
      |                                   ^
      |                                   ;
    9 |         }
      |         ~
Language: C

#include <stdio.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:
main.c: In function 'main':
main.c:32:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   32 |     data = malloc(size * sizeof(int));
      |            ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:32:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   32 |     data = malloc(size * sizeof(int));
      |            ^~~~~~
main.c:32:12: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:34:30: error: expected ';' before 'return'
   34 |     insertionSort(data, size)
      |                              ^
      |                              ;
   35 | 
   36 |     return 0;
      |     ~~~~~~
Language: C

#include <stdio.h>
void insertionSort(int*,int);
#define MAX 1001
int main(void){
	int n,i;
	int A[MAX];
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&A[i]);
	
	insertionSort(A,n);
	}
	return 0;
}

void insertionSort(int A,int n){
	int i,j,tmp,a;
	for(i=0,i<n;i++){
		tmp=A[i];
		for(j=i-1; j>=0; j--){
			if(A[j]>tmp){
				A[j+1]=A[j];
				A[j]=tmp;
			}
		}
		for(a=0; a<n; a++){
			printf("%d",A[i]);
			if(a!=n-1)printf(" ");
		}
		if(i!=n-1)printf("\n");
	}

}

Compiler output:
main.c:14:9: error: expected identifier or '(' before 'return'
   14 |         return 0;
      |         ^~~~~~
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
main.c:17:6: error: conflicting types for 'insertionSort'; have 'void(int,  int)'
   17 | void insertionSort(int A,int n){
      |      ^~~~~~~~~~~~~
main.c:2:6: note: previous declaration of 'insertionSort' with type 'void(int *, int)'
    2 | void insertionSort(int*,int);
      |      ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:19:24: error: expected ';' before ')' token
   19 |         for(i=0,i<n;i++){
      |                        ^
      |                        ;
main.c:20:22: error: subscripted value is neither array nor pointer nor vector
   20 |                 tmp=A[i];
      |                      ^
main.c:22:29: error: subscripted value is neither array nor pointer nor vector
   22 |                         if(A[j]>tmp){
      |                             ^
main.c:23:34: error: subscripted value is neither array nor pointer nor vector
   23 |                                 A[j+1]=A[j];
      |                                  ^
main.c:23:41: error: subscripted value is neither array nor pointer nor vector
   23 |                                 A[j+1]=A[j];
      |                                         ^
main.c:24:34: error: subscripted value is neither array nor pointer nor vector
   24 |                                 A[j]=tmp;
      |                                  ^
main.c:28:38: error: subscripted value is neither array nor pointer nor vector
   28 |                         printf("%d",A[i]);
      |                                      ^
Language: C

#include <stdio.h>
void insertionSort(int*,int);
#define MAX 1001
int main(void){
	int n,i;
	int A[MAX];
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&A[i]);
	
	insertionSort(A,n);
	return 0;
}

void insertionSort(int A,int n){
	int i,j,tmp,a;
	for(i=0;i<n;i++){
		tmp=A[i];
		for(j=i-1; j>=0; j--){
			if(A[j]>tmp){
				A[j+1]=A[j];
				A[j]=tmp;
			}
		}
		for(a=0; a<n; a++){
			printf("%d",A[i]);
			if(a!=n-1)printf(" ");
		}
		if(i!=n-1)printf("\n");
	}

}

Compiler output:
main.c:16:6: error: conflicting types for 'insertionSort'; have 'void(int,  int)'
   16 | void insertionSort(int A,int n){
      |      ^~~~~~~~~~~~~
main.c:2:6: note: previous declaration of 'insertionSort' with type 'void(int *, int)'
    2 | void insertionSort(int*,int);
      |      ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:19:22: error: subscripted value is neither array nor pointer nor vector
   19 |                 tmp=A[i];
      |                      ^
main.c:21:29: error: subscripted value is neither array nor pointer nor vector
   21 |                         if(A[j]>tmp){
      |                             ^
main.c:22:34: error: subscripted value is neither array nor pointer nor vector
   22 |                                 A[j+1]=A[j];
      |                                  ^
main.c:22:41: error: subscripted value is neither array nor pointer nor vector
   22 |                                 A[j+1]=A[j];
      |                                         ^
main.c:23:34: error: subscripted value is neither array nor pointer nor vector
   23 |                                 A[j]=tmp;
      |                                  ^
main.c:27:38: error: subscripted value is neither array nor pointer nor vector
   27 |                         printf("%d",A[i]);
      |                                      ^
Language: C

#include <stdio.h>
void insertionSort(int,int);
#define MAX 1001
int main(void){
	int n,i;
	int A[MAX];
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&A[i]);
	
	insertionSort(A,n);
	return 0;
}

void insertionSort(int A[],int n){
	int i,j,tmp,a;
	for(i=0;i<n;i++){
		tmp=A[i];
		for(j=i-1; j>=0; j--){
			if(A[j]>tmp){
				A[j+1]=A[j];
				A[j]=tmp;
			}
		}
		for(a=0; a<n; a++){
			printf("%d",A[i]);
			if(a!=n-1)printf(" ");
		}
		if(i!=n-1)printf("\n");
	}

}

Compiler output:
main.c: In function 'main':
main.c:12:23: error: passing argument 1 of 'insertionSort' makes integer from pointer without a cast [-Wint-conversion]
   12 |         insertionSort(A,n);
      |                       ^
      |                       |
      |                       int *
main.c:2:20: note: expected 'int' but argument is of type 'int *'
    2 | void insertionSort(int,int);
      |                    ^~~
main.c: At top level:
main.c:16:6: error: conflicting types for 'insertionSort'; have 'void(int *, int)'
   16 | void insertionSort(int A[],int n){
      |      ^~~~~~~~~~~~~
main.c:2:6: note: previous declaration of 'insertionSort' with type 'void(int,  int)'
    2 | void insertionSort(int,int);
      |      ^~~~~~~~~~~~~
Language: C

#include<stdio.h>

int main(){

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

  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-i;
      while(j>=0&&A[j]>v){
	a[j+1]=A[j];
	j--;
	A[j+1]=v;
      }
  }
}
  return 0;

Compiler output:
main.c: In function 'main':
main.c:9:13: error: 'n' undeclared (first use in this function)
    9 |   for(i=0;i<n;i++){
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:9: error: 'a' undeclared (first use in this function)
   19 |         a[j+1]=A[j];
      |         ^
main.c: At top level:
main.c:25:3: error: expected identifier or '(' before 'return'
   25 |   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 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:7:8: error: expected expression before '%' token
    7 | printf(%d,A[i]);
      |        ^
Language: C

#include<stdio.h>
using namespace std;
int a[1000000];
void t(int a[],int n)
{
	int i;
	for(i=0;i<n;i++)
	{
		if(i>0) printf(" ");
		printf("%d",a[i]);
	}
	printf("\n");
}
void s(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;
	    t(a,n);
	}
}
int main()
{
	int n,i,j;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	scanf("%d",&a[i]);
	t(a,n);
	s(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

int main(){
int N, i, j;
scanf("%d%d%d", &N, &i, &j);
for i = 1 to N.length-1
key = N[i]
j = i - 1
while j >= 0 and N[j] > key
N[j+1] = N[j]
j--
N[j+1] = key
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 | scanf("%d%d%d", &N, &i, &j);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 | scanf("%d%d%d", &N, &i, &j);
      | ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:5: error: expected '(' before 'i'
    4 | for i = 1 to N.length-1
      |     ^
      |     (
Language: C

#include<stdio.h>

int main(){
	int i, j, k;
	int N;
	scanf("%d\n", &N);

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

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

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

#include<stdio.h>
#define MAX 100

void print_array(int array[], int N)
{
        int i;
        for(i=0; i<N; i++)printf("%d ", array[i]);
        printf("\n");
}

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

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

        print_array(A, N);

        //sort
        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;
                }
                if(i<N-1)print_array(A, N);
        }

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

        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:37:41: error: 'array' undeclared (first use in this function)
   37 |         for(i=0; i<N; i++)printf("%d ", array[i]);
      |                                         ^~~~~
main.c:37:41: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define ELEMENT_CNT_MIN 1
#define ELEMENT_CNT_MAX 100
#define ELEMENT_MIN 0
#define ELEMENT_MAX 1000


void insertion_sort(int *arr, int size);
void put_arr(int *arr, int size);
int judge_constraint(int test_num, int min, int max);

int main(void){
    
    int element_cnt; 
	int element[ELEMENT_CNT_MAX];
    int i;
    
    /* input line 1 */
    scanf("%d", &element_cnt);
    
    if(judge_constraint(element_cnt, ELEMENT_CNT_MIN, ELEMENT_CNT_MAX) == -1)
    {
        return -1;
    }
	
	/* input line 2 */
	for(i = 0; i < element_cnt; i++)
	{
		scanf("%d", &element[i]);
		
		if(judge_constraint(element[i], ELEMENT_MIN, ELEMENT_MAX) == -1)
		{
			return -1;
		}
		
	}
	
	/* output line 1 */
	put_arr(arr, size); 
	
	/* output line 2 ~ element_cnt */
	insertion_sort(&element[0], element_cnt);
	
    return 0;
}

void insertion_sort(int *arr, int size)
{
    int tmp;
    int i, j;

    for(i = 1; i < size; i++)
    {
        tmp = arr[i];
        j = i - 1;
        
        while((j >= 0) && (arr[j] > tmp))
        {
            arr[j + 1] = arr[j];
            j--;
        }
        arr[j + 1] = tmp;
        
        put_arr(arr, size);  
    }
}

void put_arr(int *arr, int size)
{
	int i;
	
	for(i = 0; i < size - 1; i++)
	{
	    printf("%d ", arr[i]);
	}
	printf("%d\n", arr[size - 1]);
}

int judge_constraint(int test_num, int min, int max)
{
    if(test_num < min || test_num > max)
    {
        return -1;
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:17: error: 'arr' undeclared (first use in this function)
   40 |         put_arr(arr, size);
      |                 ^~~
main.c:40:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:22: error: 'size' undeclared (first use in this function); did you mean 'size_t'?
   40 |         put_arr(arr, size);
      |                      ^~~~
      |                      size_t
Language: C

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

void int_display(int *A)
{
  int i,n;
  n=A.length;
  for(i=0;i<n;i++){
    printf("%d ",A[i])
  }
  printf("\n");
}

void insertion_sort(int *A)
{
  int n,i,j,key;
  n=A.length;
  for(i=1;i<=n-1;i++){
    key=A[i];
    j=i-1;
    while(j>=0 && A[j]>key){
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=key;
    int_display(A);
  }
}

int main()
{
  int *A;
  int i,n;
  scanf("%d",&n);
  A=malloc(n*sizeof(int));
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  insertion_sort(A);
  return 0;
}

Compiler output:
main.c: In function 'int_display':
main.c:7:6: error: request for member 'length' in something not a structure or union
    7 |   n=A.length;
      |      ^
main.c:9:23: error: expected ';' before '}' token
    9 |     printf("%d ",A[i])
      |                       ^
      |                       ;
   10 |   }
      |   ~                    
main.c: In function 'insertion_sort':
main.c:17:6: error: request for member 'length' in something not a structure or union
   17 |   n=A.length;
      |      ^
Language: C

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

void int_display(int *A,int n)
{
  int i;
  for(i=0;i<n;i++){
    printf("%d ",A[i]);
  }
  printf("\n");
}

void insertion_sort(int *A,int n)
{
  int n,i,j,key;
  n=A.length;
  for(i=1;i<=n-1;i++){
    key=A[i];
    j=i-1;
    while(j>=0 && A[j]>key){
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=key;
    int_display(A,n);
  }
}

int main()
{
  int *A;
  int i,n;
  scanf("%d",&n);
  A=malloc(n*sizeof(int));
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  insertion_sort(A,n);
  return 0;
}

Compiler output:
main.c: In function 'insertion_sort':
main.c:15:7: error: 'n' redeclared as different kind of symbol
   15 |   int n,i,j,key;
      |       ^
main.c:13:32: note: previous definition of 'n' with type 'int'
   13 | void insertion_sort(int *A,int n)
      |                            ~~~~^
main.c:16:6: error: request for member 'length' in something not a structure or union
   16 |   n=A.length;
      |      ^
Language: C

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

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
Language: C

#include <stdio.h>

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

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

  printf("\n");

  }
 
 }

 return 0;

}
   

Compiler output:
main.c:35:2: error: expected identifier or '(' before 'return'
   35 |  return 0;
      |  ^~~~~~
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | }
      | ^
Language: C

#include<stdio.h>

int main ()
{
  int a[100],n,num,i,j,x=0;
  scanf("%d",&n);
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);
  for (i = 1; i < n; i++) {
    for (j = 0; j < i; j++) {
      if (a[i] < a[j]) {
        num = j;
        x++;
        break;
      }
    }
    temp = a[i];
    for(j = i; j > num; j--) {
      a[j-1]=a[j];
    }
    a[num] = temp;
    for (j = 0; j < n-1; j++)
    printf("%d "a[j]);
    printf("%d\n",a[n-1]);
    }
  printf("%d\n",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:5: error: 'temp' undeclared (first use in this function)
   17 |     temp = a[i];
      |     ^~~~
main.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:17: error: expected ')' before 'a'
   23 |     printf("%d "a[j]);
      |           ~     ^
      |                 )
Language: C

#include<stdio.h>

int main ()
{
  int a[100],n,num,i,j,x=0,temp;
  scanf("%d",&n);
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);
  for (i = 1; i < n; i++) {
    for (j = 0; j < i; j++) {
      if (a[i] < a[j]) {
        num = j;
        x++;
        break;
      }
    }
    temp = a[i];
    for(j = i; j > num; j--) {
      a[j-1]=a[j];
    }
    a[num] = temp;
    for (j = 0; j < n-1; j++)
    printf("%d "a[j]);
    printf("%d\n",a[n-1]);
    }
  printf("%d\n",x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:17: error: expected ')' before 'a'
   23 |     printf("%d "a[j]);
      |           ~     ^
      |                 )
Language: C

#include <stdio.h>

static const int N = 1000;

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

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

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

    for(i = 1; i < n; i++)
    {
        key = A[i];
        for (j = i - 1; j >= 0; j--)
        {
            if (A[j] > key)
                A[j + 1] = A[j];
            else
                break;
        }
        A[j + 1] = key;
    }
    
    trace(A, n);
    printf("%d\n", count);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:20: error: 'count' undeclared (first use in this function)
   35 |     printf("%d\n", count);
      |                    ^~~~~
main.c:35:20: 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 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 'insertionSort':
main.c:17:21: error: expected ')' before '$$'
   17 |         while(j >= 0 $$ A[j] > v){
      |              ~      ^~~
      |                     )
Language: C

#include <stdio.h>

const int klMinSize = 1;
const int klMaxSize = 100;
const int klMinElement = 0;
const int klMaxElement = 1000;

enum ChkNumResult
{
	klValid,
	klInvalid
};

void execInsertionSort( int *array, int size );
void showResult( int *array, int size );
ChkNumResult chkNumber( int number, int min, int max );

int main( void )
{
	int i, size;
	int array[klMaxSize] = {};

	scanf( "%d", &size );
	if( chkNumber( size, klMinSize, klMaxSize ) == klInvalid )
	{
		return -1;
	}

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

		if( chkNumber( array[i], klMinElement, klMaxElement ) == klInvalid )
		{
			return -1;
		}
	}

	showResult( element, size ); 

	execInsertionSort( &array[0], size );

	return 0;
}

void execInsertionSort( int *array, int size )
{
	int i, work;

	for( i = 1; i < size; i++ )
	{
		work = array[i];
		int j = i - 1;

		while( (j >= 0) && (array[j] > work) )
		{
			array[j + 1] = array[j];
			j--;
		}
		array[j + 1] = work;
		showResult( array, size );
	}
}

void showResult( int *array, int size )
{
	int i;

	for( int i = 0; i < size - 1; i++ )
	{
		printf( "%d ", array[i] );
	}
	printf( "%d\n", array[size - 1] );
}

ChkNumResult chkNumber( int number, int min, int max )
{
	return ((number < min) || (number > max)) ? klInvalid : klValid;
}

Compiler output:
main.c:16:1: error: unknown type name 'ChkNumResult'; use 'enum' keyword to refer to the type
   16 | ChkNumResult chkNumber( int number, int min, int max );
      | ^~~~~~~~~~~~
      | enum 
main.c: In function 'main':
main.c:39:21: error: 'element' undeclared (first use in this function)
   39 |         showResult( element, size );
      |                     ^~~~~~~
main.c:39:21: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:76:1: error: unknown type name 'ChkNumResult'; use 'enum' keyword to refer to the type
   76 | ChkNumResult chkNumber( int number, int min, int max )
      | ^~~~~~~~~~~~
      | enum
Language: C

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
int main() {
 
    int v, i, j,k, N;
    int A[100];
 
    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;
        printf("%d",A[0]);
        for (k = 1; k < N; k++)
            printf(" %d", A[k]);
                        printf("\n");
 
            }
 
    return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 1
      | ^
Language: C

#include <stdio.h>

int main(void)
{
  int N,i,a[N],z;
  z=0;

  scanf("%d",&N);
  for(i=1;i<=N;i++){
    a[i-1]=i;
  }
  for(i=0;i<N;i++){
    printf("%d ",a[i]);
  }
    if(a[i]>a[i+1]){
      z=a[i];
      a[i]=a[i+1];
      a[i+1]=z;
      }
  }

  return 0;
}
  
      

Compiler output:
main.c:22:3: error: expected identifier or '(' before 'return'
   22 |   return 0;
      |   ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
  int i,j,v,a[N],N;
  v=0;
  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;
    }
    printf("%d",a[i]);
    printf(" ");
  }
  return 0;
}

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

#include <stdio.h>

int main(void)
{
  int i,j,v,a[N],N;
  v=0;
  scanf("%d",&N);
  
  for(i=0,i<N;i++){
    scanf("%d",&a[i]);
    }
  
  for(i=0;i<N;i++){
    if(a[i]>a[i+1])
      z=a[i];
      a[i]=a[i+1];
      a[i+1]=z;
      for(j=0;j<N;j++){
        printf("%d",a[j]);
        printf(" ");
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: 'N' undeclared (first use in this function)
    5 |   int i,j,v,a[N],N;
      |               ^
main.c:5:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:18: error: expected ';' before ')' token
    9 |   for(i=0,i<N;i++){
      |                  ^
      |                  ;
main.c:15:7: error: 'z' undeclared (first use in this function)
   15 |       z=a[i];
      |       ^
main.c: At top level:
main.c:24:3: error: expected identifier or '(' before 'return'
   24 |   return 0;
      |   ^~~~~~
main.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
  int i,j,v,a[N],N;
  v=0;
  scanf("%d",&N);
  
  for(i=0,i<N;i++){
    scanf("%d",&a[i]);
    }
  
  for(i=0;i<N;i++){
    if(a[i]>a[i+1])
      z=a[i];
      a[i]=a[i+1];
      a[i+1]=z;
      for(j=0;j<N;j++){
        printf("%d",a[j]);
        printf(" \n");
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: 'N' undeclared (first use in this function)
    5 |   int i,j,v,a[N],N;
      |               ^
main.c:5:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:18: error: expected ';' before ')' token
    9 |   for(i=0,i<N;i++){
      |                  ^
      |                  ;
main.c:15:7: error: 'z' undeclared (first use in this function)
   15 |       z=a[i];
      |       ^
main.c: At top level:
main.c:24:3: error: expected identifier or '(' before 'return'
   24 |   return 0;
      |   ^~~~~~
main.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^
Language: C

#include <stdio.h>

void trace(int A[], int N){
  int i;
  for (i = 0; i < N; i++){
    if (i > 0) print(" ");
    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:6:16: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |     if (i > 0) print(" ");
      |                ^~~~~
      |                printf
Language: C

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

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:24:1: error: expected identifier or '(' before '?' token
   24 | ????return 0;
      | ^
main.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^
Language: C

#include<stdio.h>

void insersionSort(int A[1000], 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("%2d", A[k]);
        }
        printf("\n");
    }

}

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

    scanf("%d", &N);

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

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

    insersionSort(A, N);

    return 0;
}

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

#include<stdio.h>

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

}

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

    scanf("%d", &N);

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

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

    insersionSort(A, N);

    return 0;
}

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

#include<stdio.h>

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

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

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

Compiler output:
main.c: In function 'sort':
main.c:12:5: error: implicit declaration of function 'space' [-Wimplicit-function-declaration]
   12 |     space(A, N);
      |     ^~~~~
Language: C

#include <stdio.h>

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected identifier before '&' token
   11 |     scanf("%d". &a[i]);
      |                 ^
main.c:13:7: error: 'k' undeclared (first use in this function)
   13 |   for(k  1; k < N; k++) {
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: expected ';' before numeric constant
   13 |   for(k  1; k < N; k++) {
      |        ^ ~
      |        ;
main.c:28:10: error: expected ';' before numeric constant
   28 |     for(k  1; k < N; k++) {
      |          ^ ~
      |          ;
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected identifier before '&' token
   11 |     scanf("%d". &a[i]);
      |                 ^
main.c:13:8: error: expected ';' before numeric constant
   13 |   for(k  1; k < N; k++) {
      |        ^ ~
      |        ;
main.c:28:10: error: expected ';' before numeric constant
   28 |     for(k  1; k < N; k++) {
      |          ^ ~
      |          ;
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected identifier before '&' token
   11 |     scanf("%d". &a[i]);
      |                 ^
main.c:13:8: error: expected ';' before numeric constant
   13 |   for(k  1; k < N; k++) {
      |        ^ ~
      |        ;
main.c:28:10: error: expected ';' before numeric constant
   28 |     for(k  1; k < N; k++) {
      |          ^ ~
      |          ;
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected identifier before '&' token
   11 |     scanf("%d". &a[i]);
      |                 ^
main.c:13:8: error: expected ';' before numeric constant
   13 |   for(k  1; k < N; k++) {
      |        ^ ~
      |        ;
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:8: error: expected ';' before numeric constant
   13 |   for(k  1; k < N; k++) {
      |        ^ ~
      |        ;
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>
int main(void)
{
  int N,i,j,k,v,a[100];

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

  return 0;
}

    
  

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

#include<stdio.h>

int main () {

   int n, i, j, k, v;
   int a[100] = {0};

   scanf("%d",&n);

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

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

      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++)
      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:14:13: error: expected ';' before 'i'
   14 |    for(i = 1 i < n; i++){
      |             ^~
      |             ;
main.c:14:24: error: expected ';' before ')' token
   14 |    for(i = 1 i < n; i++){
      |                        ^
      |                        ;
main.c: At top level:
main.c:33:4: error: expected identifier or '(' before 'for'
   33 |    for(k = 0; k < n; k++)
      |    ^~~
main.c:33:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   33 |    for(k = 0; k < n; k++)
      |                 ^
main.c:33:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   33 |    for(k = 0; k < n; k++)
      |                       ^~
main.c:36:9: error: expected identifier or '(' before 'else'
   36 |       } else {
      |         ^~~~
main.c:39:4: error: expected identifier or '(' before '}' token
   39 |    }
      |    ^
main.c:41:4: error: expected identifier or '(' before 'return'
   41 |    return 0;
      |    ^~~~~~
main.c:43:1: error: expected identifier or '(' before '}' token
   43 | }
      | ^
Language: C

#include<stdio.h>

int main () {

   int n, i, j, k, v;
   int a[100] = {0};

   scanf("%d",&n);

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

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

      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++)
      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:14:13: error: expected ';' before 'i'
   14 |    for(i = 1 i < n; i++){
      |             ^~
      |             ;
main.c:14:24: error: expected ';' before ')' token
   14 |    for(i = 1 i < n; i++){
      |                        ^
      |                        ;
main.c: At top level:
main.c:41:4: error: expected identifier or '(' before 'return'
   41 |    return 0;
      |    ^~~~~~
main.c:43:1: error: expected identifier or '(' before '}' token
   43 | }
      | ^
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[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:47:1: error: expected declaration or statement at end of input
   47 | }
      | ^