criyle/codenet-compile-errors huggingface dataset:
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]);
      }
     }

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[i]>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:18: error: 'a' undeclared (first use in this function)
   17 |           A[j+1]=a[j];
      |                  ^
main.c:17:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:24:8: error: expected identifier or '(' before '}' token
   24 |        }
      |        ^
main.c: In function 'main':
main.c:31:37: error: expected ')' before ';' token
   31 |    for(i=0;i<N;i++) scanf("%d",&A[i];
      |                          ~          ^
      |                                     )
main.c:36:13: error: expected ';' before '}' token
   36 |    return 0;
      |             ^
      |             ;
   37 | }
      | ~
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[i]>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:18:18: error: 'a' undeclared (first use in this function)
   18 |           A[j+1]=a[j];
      |                  ^
main.c:18:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:32:37: error: expected ')' before ';' token
   32 |    for(i=0;i<N;i++) scanf("%d",&A[i];
      |                          ~          ^
      |                                     )
main.c:37:13: error: expected ';' before '}' token
   37 |    return 0;
      |             ^
      |             ;
   38 | }
      | ~
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[i]>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 'main':
main.c:30:37: error: expected ')' before ';' token
   30 |    for(i=0;i<N;i++) scanf("%d",&A[i];
      |                          ~          ^
      |                                     )
main.c:35:13: error: expected ';' before '}' token
   35 |    return 0;
      |             ^
      |             ;
   36 | }
      | ~
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[i]>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 'main':
main.c:30:37: error: expected ')' before ';' token
   30 |    for(i=0;i<N;i++) scanf("%d",&A[i];
      |                          ~          ^
      |                                     )
main.c:35:13: error: expected ';' before '}' token
   35 |    return 0;
      |             ^
      |             ;
   36 | }
      | ~
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;
  int v;
  int A[N+1];
  scanf("%d",&N);
  
	for(i=0;i<N;i++) scanf("%d",&A[i]);
	
	trace(A,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;
         trace(A,N);
        }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:9: error: 'N' undeclared (first use in this function)
   15 |   int A[N+1];
      |         ^
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
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");
}

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

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

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

  return 0;
}

Compiler output:
main.c: In function 'selectionSort':
main.c:16:16: error: 'a' undeclared (first use in this function)
   16 |     int temp = a[i];
      |                ^
main.c:16:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)


int main(void){
    int a[200],key,n;

    scanf("%d",&n);

    REP(i,n){
        scanf("%d",&a[i]);
    }
    REP(i,n)
        if(i < n - 1)
            printf("%d ",a[i]);
        else
            printf("%d\n",a[i]);

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

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

#include<stdio.h>

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

return 0;

}


	
	

Compiler output:
main.c: In function 'main':
main.c:28:28: error: expected ')' before 'A'
   28 |                 printf("&d" A[N-1]);
      |                       ~    ^~
      |                            )
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ara[101],i,j,n,mini,cou,key,k;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&ara[i]);
    }
    for(i=1;i<n;i++){
        key=ara[i];
        j=i-1;
        while(j>=0&&ara[j]>key){
            ara[j+1]=ara[j];
            j--;
        }
        ara[j+1]=key;
        for(k=0;k<n;++k){
        printf("%d",ara[k]);
        if (k<(n-1))
            printf(" ");
    }
    printf("\n");
    }
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
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 insertSort(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_s("%d", &N);
	for (i = 0; i < N; i++)
		scanf_s("%d", &A[i]);
	trace(A, N);
	insertSort(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;
      |                 ^~~
main.c: In function 'main':
main.c:27:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   27 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>

int main(){

  int array[124] = {};
  int i,j,v = 0,n,k;
  scanf("%d",&n);
  
  for(i = 0;i < n;i++){
    scanf("%d",&array[i]);
  }

  for(i = 1;i <= n;i++){
    v = array[i];
    j = i - 1;
    for(k = 0;k < n;k++){
      if (k != n - 1) printf("%d ",array[k]);
      else printf("%d",array[k]);
      
    printf("\n");
    
    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:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

#include <stdio.h>

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

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

  scanf("%d", &n);

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

  printf("\n");
  output(A, n);
  
  for(i = 2; 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;
    output(A, n);
  }

  return 0;
}

Compiler output:
main.c: In function 'output':
main.c:7:1: error: expected expression before '?' token
    7 | ??????if(i < n)printf(" ");
      | ^
Language: C

#include<stdio.h>
void trace(int,int);
void sort(int,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);
sort(A,N);

}

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 sort(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);
}
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:12:7: error: passing argument 1 of 'trace' makes integer from pointer without a cast [-Wint-conversion]
   12 | trace(A,N);
      |       ^
      |       |
      |       int *
main.c:2:12: note: expected 'int' but argument is of type 'int *'
    2 | void trace(int,int);
      |            ^~~
main.c:13:6: error: passing argument 1 of 'sort' makes integer from pointer without a cast [-Wint-conversion]
   13 | sort(A,N);
      |      ^
      |      |
      |      int *
main.c:3:11: note: expected 'int' but argument is of type 'int *'
    3 | void sort(int,int);
      |           ^~~
main.c: At top level:
main.c:17:6: error: conflicting types for 'trace'; have 'void(int *, int)'
   17 | void trace(int A[],int N){
      |      ^~~~~
main.c:2:6: note: previous declaration of 'trace' with type 'void(int,  int)'
    2 | void trace(int,int);
      |      ^~~~~
main.c: In function 'trace':
main.c:24:13: error: expected ';' before '}' token
   24 | printf("\n")
      |             ^
      |             ;
   25 | }
      | ~            
main.c: At top level:
main.c:27:6: error: conflicting types for 'sort'; have 'void(int *, int)'
   27 | void sort(int A[],int N){
      |      ^~~~
main.c:3:6: note: previous declaration of 'sort' with type 'void(int,  int)'
    3 | void sort(int,int);
      |      ^~~~
Language: C

#include<stdio.h>
void trace(int,int);
void sort(int,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);
sort(A,N);

}

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 sort(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);
}
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:12:7: error: passing argument 1 of 'trace' makes integer from pointer without a cast [-Wint-conversion]
   12 | trace(A,N);
      |       ^
      |       |
      |       int *
main.c:2:12: note: expected 'int' but argument is of type 'int *'
    2 | void trace(int,int);
      |            ^~~
main.c:13:6: error: passing argument 1 of 'sort' makes integer from pointer without a cast [-Wint-conversion]
   13 | sort(A,N);
      |      ^
      |      |
      |      int *
main.c:3:11: note: expected 'int' but argument is of type 'int *'
    3 | void sort(int,int);
      |           ^~~
main.c: At top level:
main.c:17:6: error: conflicting types for 'trace'; have 'void(int *, int)'
   17 | void trace(int A[],int N){
      |      ^~~~~
main.c:2:6: note: previous declaration of 'trace' with type 'void(int,  int)'
    2 | void trace(int,int);
      |      ^~~~~
main.c:27:6: error: conflicting types for 'sort'; have 'void(int *, int)'
   27 | void sort(int A[],int N){
      |      ^~~~
main.c:3:6: note: previous declaration of 'sort' with type 'void(int,  int)'
    3 | void sort(int,int);
      |      ^~~~
Language: C

#include<stdio.h>
void trace(int,int);
void sort(int,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);
sort(A,N);

return 0;

}

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 sort(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);
}
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:12:7: error: passing argument 1 of 'trace' makes integer from pointer without a cast [-Wint-conversion]
   12 | trace(A,N);
      |       ^
      |       |
      |       int *
main.c:2:12: note: expected 'int' but argument is of type 'int *'
    2 | void trace(int,int);
      |            ^~~
main.c:13:6: error: passing argument 1 of 'sort' makes integer from pointer without a cast [-Wint-conversion]
   13 | sort(A,N);
      |      ^
      |      |
      |      int *
main.c:3:11: note: expected 'int' but argument is of type 'int *'
    3 | void sort(int,int);
      |           ^~~
main.c: At top level:
main.c:19:6: error: conflicting types for 'trace'; have 'void(int *, int)'
   19 | void trace(int A[],int N){
      |      ^~~~~
main.c:2:6: note: previous declaration of 'trace' with type 'void(int,  int)'
    2 | void trace(int,int);
      |      ^~~~~
main.c:29:6: error: conflicting types for 'sort'; have 'void(int *, int)'
   29 | void sort(int A[],int N){
      |      ^~~~
main.c:3:6: note: previous declaration of 'sort' with type 'void(int,  int)'
    3 | void sort(int,int);
      |      ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAX 100
int main(){

  int key,i,j,n,c;
  int arry[MAX];

  scanf("%d",&n);
  if(n<1)exit(2);
  for(i=0;i<n;i++)
    scanf("%d",&arry[i]);
  
  for(i=0;i<n;i++)
    printf("%d ",&array[i]);
  
     for(i=1;i<n;i++){
      key=arry[i];
      j=i-1;
      while(j>=0 && arry[j]>key ){
	arry[j+1]=arry[j];
	j--;
	arry[j+1]=key;
    }
     for(c=0;c<n;c++)
      printf("%d ",arry[c]);
      printf("\n");
  }
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:15:19: error: 'array' undeclared (first use in this function); did you mean 'arry'?
   15 |     printf("%d ",&array[i]);
      |                   ^~~~~
      |                   arry
main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAX 100
int main(){

  int key,i,j,n,arry[MAX];

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&arry[i]);
  
  for(i=0;i<n;i++)
    printf("%-2d ",arry[i]);

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

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

#include <stdio.h>
#define MAX 100
int main(){

  int key,i,j,n,a;
  int arry[MAX];

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&arry[i]);
  
  for(i=0;i<n;i++)
    printf("%-2d",arry[i]);

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

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

#include <stdio.h>
#define MAX 100
int main(){

  int key,i,j,n,a;
  int arry[MAX];

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

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

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

#include<stdio.h>

int main( ){

  int N=0,i,key,A[N],j,z;
  if(0>A[i]||1000<A[i]){ i--;
      continue;
    }

  scanf("%d",&N);


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


  for(z=0;z<N;z++){
    printf("%d ",A[z]);

  }

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

    }

    printf("\n");

    
  }

  return 0;
}
      

  

Compiler output:
main.c: In function 'main':
main.c:7:7: error: continue statement not within a loop
    7 |       continue;
      |       ^~~~~~~~
Language: C

#include<stdio.h>

static const int N = 1000;

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

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

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

  for(j=1; j<=n; j++){
    key = A[j];
    i = j-1;

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

  }

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

#include <stdio.h>
#include <stdlib.h>
int main(){
  int N,i,key,*A,j,n;
  scanf("%d",&N);
  A=(int*)malloc(N);
  for(i=0;i<N;i++)
    scanf("%d",&A[i]);
  for(i=1;i<N;i++){
  key=A[i];
  /* insert A[i] into the sorted sequence A[0,...,j-1] */
  j=i-1;
  while(j>=0 && A[j]>key){  
    A[j+1] = A[j];
    j--;
    A[j+1] = key;
  }
  for(n=0;n<N;n++)
  printf("%d",A[n]);
  printf("\n");

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

Compiler output:
main.c: In function 'main':
main.c:25:15: error: expected ';' before 'return'
   25 |   printf("\n")
      |               ^
      |               ;
   26 |   return 0;
      |   ~~~~~~
Language: C

#include <stdio.h>

#define N 1000

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

	pritnf("\n");

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:9: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   31 |         pritnf("\n");
      |         ^~~~~~
      |         printf
Language: C

#include<stdio.h>
//include<stdlib.h>
int main(){
  int i,j,v,n,A,N;
  
  scanf("%d",&N);
 // A=malloc(sizeof(int)*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(n=0;n<N;n++){
      printf("%2d",A[n]);
    }
    
    printf("\n");
    free(A);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:33: error: subscripted value is neither array nor pointer nor vector
    8 |   for(i=0;i<N;i++) scanf("%d",&A[i]);
      |                                 ^
main.c:11:8: error: subscripted value is neither array nor pointer nor vector
   11 |     v=A[i];
      |        ^
main.c:14:20: error: subscripted value is neither array nor pointer nor vector
   14 |     while(j>=0 && A[j]>v){
      |                    ^
main.c:15:8: error: subscripted value is neither array nor pointer nor vector
   15 |       A[j+1]=A[j];
      |        ^
main.c:15:15: error: subscripted value is neither array nor pointer nor vector
   15 |       A[j+1]=A[j];
      |               ^
main.c:19:6: error: subscripted value is neither array nor pointer nor vector
   19 |     A[j+1]=v;
      |      ^
main.c:21:21: error: subscripted value is neither array nor pointer nor vector
   21 |       printf("%2d",A[n]);
      |                     ^
main.c:25:5: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   25 |     free(A);
      |     ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'free'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | //include<stdlib.h>
main.c:25:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   25 |     free(A);
      |     ^~~~
main.c:25:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:25:10: error: passing argument 1 of 'free' makes pointer from integer without a cast [-Wint-conversion]
   25 |     free(A);
      |          ^
      |          |
      |          int
main.c:25:10: note: expected 'void *' but argument is of type 'int'
Language: C

file:///home/student/s1240081/alg1/lec01/A.c/insertsort.c

Compiler output:
main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    1 | file:///home/student/s1240081/alg1/lec01/A.c/insertsort.c
      |     ^
Language: C

#include <stdio.h>

int main(){
	
	int count;	
	scanf("%d", &count);
	
	int *input_data = (int *)malloc(sizeof(int) * count);
	
	for(int i = 0; i < count; i++){
		scanf("%d", input_data + i);
	}
	
	for(int i = 1; i < count; i++){
		
		int target_value = input_data[i];
		int j = i - 1;
		
		while(j >= 0 && input_data[j] > target_value){
			input_data[j + 1] = input_data[j];
			j--;
		}
		
		input_data[j + 1] = target_value;
		
		for(int k = 0; k < count; k++){
			if(k == count - 1){
				printf("%d\n", input_data[k]);
			}
			else{
				printf("%d ", input_data[k]);
			}
		}
	
	}
	
	free(input_data);
	
	return 0;
	
}

Compiler output:
main.c: In function 'main':
main.c:8:34: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |         int *input_data = (int *)malloc(sizeof(int) * count);
      |                                  ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:34: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |         int *input_data = (int *)malloc(sizeof(int) * count);
      |                                  ^~~~~~
main.c:8:34: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:37:9: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   37 |         free(input_data);
      |         ^~~~
main.c:37:9: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:37:9: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:37:9: note: include '<stdlib.h>' or provide a declaration of 'free'
Language: C

for (c = 1 ; c <= n - 1; c++) {
    d = c;
 
    while ( d > 0 && array[d] < array[d-1]) {
      t          = array[d];
      array[d]   = array[d-1];
      array[d-1] = t;
 
      d--;
    }
  }
 
  printf("Sorted list in ascending order:\n");
 
  for (c = 0; c <= n - 1; c++) {
    printf("%d\n", array[c]);
  }

Compiler output:
main.c:1:1: error: expected identifier or '(' before 'for'
    1 | for (c = 1 ; c <= n - 1; c++) {
      | ^~~
main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    1 | for (c = 1 ; c <= n - 1; c++) {
      |                ^~
main.c:1:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 | for (c = 1 ; c <= n - 1; c++) {
      |                           ^~
main.c:13:10: error: expected declaration specifiers or '...' before string constant
   13 |   printf("Sorted list in ascending order:\n");
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:15:3: error: expected identifier or '(' before 'for'
   15 |   for (c = 0; c <= n - 1; c++) {
      |   ^~~
main.c:15:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   15 |   for (c = 0; c <= n - 1; c++) {
      |                 ^~
main.c:15:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |   for (c = 0; c <= n - 1; c++) {
      |                            ^~
Language: C

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

Compiler output:
main.c:1:2: error: expected identifier or '(' before 'for'
    1 |  for(i=0;i<n-1;i++){
      |  ^~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 |  for(i=0;i<n-1;i++){
      |           ^
main.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 |  for(i=0;i<n-1;i++){
      |                 ^~
main.c:14:3: error: expected identifier or '(' before 'return'
   14 |   return 0;
      |   ^~~~~~
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C

include <stdio.h>

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

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>

int main(){
  int i = 0,j,k,length,key,A[N];
  while(1){
    scanf("%d",&length);
    if(1 <= length && length <= 100) break;
    printf("Enter again!(1 <= length <= 100):");
  }
  while(i < length){
    scanf("%d",&A[i]);
    i++;
  }
  for(i = 1;i < length;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 < length;k++) printf("%d ",A[k]);
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:30: error: 'N' undeclared (first use in this function)
    4 |   int i = 0,j,k,length,key,A[N];
      |                              ^
main.c:4:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

    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

Compiler output:
main.c:1:5: warning: data definition has no type or storage class
    1 |     key = A[i]
      |     ^~~
main.c:1:5: error: type defaults to 'int' in declaration of 'key' [-Wimplicit-int]
main.c:1:11: error: 'A' undeclared here (not in a function)
    1 |     key = A[i]
      |           ^
main.c:1:13: error: 'i' undeclared here (not in a function)
    1 |     key = A[i]
      |             ^
main.c:3:5: error: expected ',' or ';' before 'j'
    3 |     j = i - 1
      |     ^
Language: C

#include <stdio.h>
#define N 100

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

Compiler output:
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>
#define N 100

int main(){
  int i,j,k,A[N],n,v;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  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++){
      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:28:3: error: expected declaration or statement at end of input
   28 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>

int card[6];
void swap(int *a, int *b)
{
  int temp;

  temp = *a;
  *a = *b;
  *b = temp;
}

int main(void)
{
	int i,j;
scanf("%d",&j);
j=j-1;
for(i=1;j>=0;i++){
  printf("%d ",i);
  j--;
  }

  int i, j;

  /* ????????¶??????????????\??? */
  printf("input 6 numbers...?\n");
  for (i=0; i<=5; i++) {
    scanf("%d", &(card[i]));
  }

  /* ????????¶????????¨??? */
  printf("before...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }

  /* ?????´???????????? -- ????????????1??????????????????????????? */
  for (i=0; i<=5; i++) {
    /* ?????´???????????? --
       ??????????¬????????????????????????????????????????
       ?°????????????°????????\???????????? */
    for (j=i+1; j<=5; j++) {
      if (card[i] > card[j]) {
        swap(&(card[i]), &(card[j]));
      }
    }
  }

  /* ????????????????????¶????????¨??? */
  printf("?\n");
  printf("after...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }
}

Compiler output:
main.c: In function 'main':
main.c:23:7: error: redeclaration of 'i' with no linkage
   23 |   int i, j;
      |       ^
main.c:15:13: note: previous declaration of 'i' with type 'int'
   15 |         int i,j;
      |             ^
main.c:23:10: error: redeclaration of 'j' with no linkage
   23 |   int i, j;
      |          ^
main.c:15:15: note: previous declaration of 'j' with type 'int'
   15 |         int i,j;
      |               ^
Language: C

#include <stdio.h>


void swap(int *a, int *b)
{
  int temp;

  temp = *a;
  *a = *b;
  *b = temp;
}

int main(void)
{
	int card[6];
	int i,j;
scanf("%d",&j);
j=j-1;
for(i=1;j>=0;i++){
  printf("%d ",i);
  j--;
  }

  int i, j;

  /* ????????¶??????????????\??? */
  printf("input 6 numbers...?\n");
  for (i=0; i<=5; i++) {
    scanf("%d", &(card[i]));
  }

  /* ????????¶????????¨??? */
  printf("before...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }

  /* ?????´???????????? -- ????????????1??????????????????????????? */
  for (i=0; i<=5; i++) {
    /* ?????´???????????? --
       ??????????¬????????????????????????????????????????
       ?°????????????°????????\???????????? */
    for (j=i+1; j<=5; j++) {
      if (card[i] > card[j]) {
        swap(&(card[i]), &(card[j]));
      }
    }
  }

  /* ????????????????????¶????????¨??? */
  printf("?\n");
  printf("after...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }
}

Compiler output:
main.c: In function 'main':
main.c:24:7: error: redeclaration of 'i' with no linkage
   24 |   int i, j;
      |       ^
main.c:16:13: note: previous declaration of 'i' with type 'int'
   16 |         int i,j;
      |             ^
main.c:24:10: error: redeclaration of 'j' with no linkage
   24 |   int i, j;
      |          ^
main.c:16:15: note: previous declaration of 'j' with type 'int'
   16 |         int i,j;
      |               ^
Language: C

#include <stdio.h>


void swap(int *a, int *b)
{
  int temp;

  temp = *a;
  *a = *b;
  *b = temp;
}

int main(void)
{
	int card[6];
	int i,j;
scanf("%d",&j);
j=j-1;
for(i=1;j>=0;i++){
  printf("%d ",i);
  j--;
  }

  int i, j;

  /* ????????¶??????????????\??? */

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


  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }

  /* ?????´???????????? -- ????????????1??????????????????????????? */
  for (i=0; i<=5; i++) {
    /* ?????´???????????? --
       ??????????¬????????????????????????????????????????
       ?°????????????°????????\???????????? */
    for (j=i+1; j<=5; j++) {
      if (card[i] > card[j]) {
        swap(&(card[i]), &(card[j]));
      }
    }
  }

  /* ????????????????????¶????????¨??? */
  printf("?\n");
  printf("after...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }
}

Compiler output:
main.c: In function 'main':
main.c:24:7: error: redeclaration of 'i' with no linkage
   24 |   int i, j;
      |       ^
main.c:16:13: note: previous declaration of 'i' with type 'int'
   16 |         int i,j;
      |             ^
main.c:24:10: error: redeclaration of 'j' with no linkage
   24 |   int i, j;
      |          ^
main.c:16:15: note: previous declaration of 'j' with type 'int'
   16 |         int i,j;
      |               ^
Language: C

#include <stdio.h>


void swap(int *a, int *b)
{
  int temp;

  temp = *a;
  *a = *b;
  *b = temp;
}

int main(void)
{
	int card[6];
	int i,j;
scanf("%d",&j);
j=j-1;
for(i=1;j>=0;i++){
  printf("%d ",i);
  j--;
  }

  int i, j;

  /* ????????¶??????????????\??? */

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


  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }

  /* ?????´???????????? -- ????????????1??????????????????????????? */
  for (i=0; i<=5; i++) {
    /* ?????´???????????? --
       ??????????¬????????????????????????????????????????
       ?°????????????°????????\???????????? */
    for (j=i+1; j<=5; j++) {
      if (card[i] > card[j]) {
        swap(&(card[i]), &(card[j]));
      }
    }
  }

  /* ????????????????????¶????????¨??? */
  printf("?\n");
  printf("after...?\n");
  for (i=0; i<=5; i++) {
    printf("%d ", card[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:7: error: redeclaration of 'i' with no linkage
   24 |   int i, j;
      |       ^
main.c:16:13: note: previous declaration of 'i' with type 'int'
   16 |         int i,j;
      |             ^
main.c:24:10: error: redeclaration of 'j' with no linkage
   24 |   int i, j;
      |          ^
main.c:16:15: note: previous declaration of 'j' with type 'int'
   16 |         int i,j;
      |               ^
Language: C

    for(i = 0; i < n; i++){
        scanf("%d", &r[i]);
        
        if(i != 0 && r[i-1] > r[i]){
            temp = r[i-1]; 
            r[i-1] = r[i];
            r[i] = temp;
        } 
        
    printf("%d ", r[i]);
    
    }
    

Compiler output:
main.c:1:5: error: expected identifier or '(' before 'for'
    1 |     for(i = 0; i < n; i++){
      |     ^~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 |     for(i = 0; i < n; i++){
      |                  ^
main.c:1:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 |     for(i = 0; i < n; i++){
      |                        ^~
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 inseertionsort(intA[],int N)
{
  int i,j,v;
  for(i = 1; i < N; i++)
  {
    v = A[i];
    j = i - 1;
    while(j >= 0 && v < A[j])
    {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;
    trace(A,N);
  }
}

int main()
{
  int N,i,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:16:21: error: unknown type name 'intA'; did you mean 'int'?
   16 | void inseertionsort(intA[],int N)
      |                     ^~~~
      |                     int
main.c: In function 'main':
main.c:46:3: error: implicit declaration of function 'insertionsort' [-Wimplicit-function-declaration]
   46 |   insertionsort(A,N);
      |   ^~~~~~~~~~~~~
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(intA[],int N)
{
  int i,j,v;
  for(i = 1; i < N; i++)
  {
    v = A[i];
    j = i - 1;
    while(j >= 0 && v < A[j])
    {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;
    trace(A,N);
  }
}

int main(void)
{
  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:16:20: error: unknown type name 'intA'; did you mean 'int'?
   16 | void insertionsort(intA[],int N)
      |                    ^~~~
      |                    int
main.c: In function 'main':
main.c:46:3: error: implicit declaration of function 'insertionsort' [-Wimplicit-function-declaration]
   46 |   insertionsort(A,N);
      |   ^~~~~~~~~~~~~
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(intA[],int N)
{
  int i,j,v;
  for(i = 1; i < N; i++)
  {
    v = A[i];
    j = i - 1;
    while(j >= 0 && v < A[j])
    {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;
    trace(A,N);
  }
}

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

  return 0;
}

Compiler output:
main.c:16:20: error: unknown type name 'intA'; did you mean 'int'?
   16 | void insertionsort(intA[],int N)
      |                    ^~~~
      |                    int
main.c: In function 'main':
main.c:42:17: error: expected expression before '[' token
   42 |     scanf("%d",&[A]);
      |                 ^
main.c:46:3: error: implicit declaration of function 'insertionsort' [-Wimplicit-function-declaration]
   46 |   insertionsort(A,N);
      |   ^~~~~~~~~~~~~
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(intA[],int N)
{
  int i,j,v;
  for(i = 1; i < N; i++)
  {
    v = A[i];
    j = i - 1;
    while(j >= 0 && v < A[j])
    {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;
    trace(A,N);
  }
}

int main(void)
{
  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:16:20: error: unknown type name 'intA'; did you mean 'int'?
   16 | void insertionsort(intA[],int N)
      |                    ^~~~
      |                    int
main.c: In function 'main':
main.c:46:3: error: implicit declaration of function 'insertionsort' [-Wimplicit-function-declaration]
   46 |   insertionsort(A,N);
      |   ^~~~~~~~~~~~~
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:15:19: error: 'a' undeclared (first use in this function)
   15 |                 v=a[i];
      |                   ^
main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:35: error: expected ')' before '{' token
   17 |                 while(j>=0&&a[j]>v{
      |                      ~            ^
      |                                   )
main.c:23:9: error: expected expression before '}' token
   23 |         }
      |         ^
main.c: In function 'main':
main.c:31:13: error: 'I' undeclared (first use in this function)
   31 |         for(I-0;i<N;i++)scanf("%d",&A[i]);
      |             ^
Language: C

#include<studio.h>
int main(void){
	int A[100];
	int i,j,k;
	int v=0;
	int N=0;
	
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",A[i]);
	}
	
	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;
		}
		for(k=0;k<N-1;k++){
			printf("%d ",A[k]);
		}
		printf("%d",A[N-1]);
	}
	return 0;
}

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

#include<studio.h>
int main(void){
	int A[100];
	int i,j,k;
	int v=0;
	int N=0;
	
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",A[i]);
	}
	
	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;
		}
		for(k=0;k<N-1;k++){
			printf("%d ",A[k]);
		}
		printf("%d\n",A[N-1]);
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: studio.h: No such file or directory
    1 | #include<studio.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("\n");
}

void Sort(int A[],int N){
int i,v,j;
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  msin(){
int N,i,j;
int A[100];

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

Compiler output:
main.c: In function 'msin':
main.c:29:17: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   29 | for(i=0;i<N;i++)sacnf("%d", &A[i]);
      |                 ^~~~~
      |                 scanf
main.c: In function 'trace':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
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 insertion(int A[],int N){
	int i,j,v;
	for(i=1;i<N;i++){
		v = A[i];
		j =i-1;
		while(j<=0&&A[j]>v){
			A[j+1] = A[j];
			j--;
		}A[j+1] = v;
		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);
	insertion(A.N);
	return 0
}
		

Compiler output:
main.c: In function 'main':
main.c:32:20: error: request for member 'N' in something not a structure or union
   32 |         insertion(A.N);
      |                    ^
main.c:32:9: error: too few arguments to function 'insertion'
   32 |         insertion(A.N);
      |         ^~~~~~~~~
main.c:12:6: note: declared here
   12 | void insertion(int A[],int N){
      |      ^~~~~~~~~
main.c:33:17: error: expected ';' before '}' token
   33 |         return 0
      |                 ^
      |                 ;
   34 | }
      | ~
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){
			v=A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		trace(A,N);
	}
}
iny 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:23:1: error: unknown type name 'iny'; did you mean 'int'?
   23 | iny main(){
      | ^~~
      | int
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, v, j;
		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(void){
		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);l
				
		return 0;
	}

Compiler output:
main.c: In function 'insertionSort':
main.c:15:35: error: 'n' undeclared (first use in this function)
   15 |                 for ( i = 1; i <= n; i++ ){
      |                                   ^
main.c:15:35: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:46: error: expected ';' before 'j'
   20 |                                 A[j+1] = A[j]
      |                                              ^
      |                                              ;
   21 |                                 j--;
      |                                 ~             
main.c: In function 'main':
main.c:36:37: error: 'l' undeclared (first use in this function)
   36 |                 insertionSort(A, N);l
      |                                     ^
main.c:36:38: error: expected ';' before 'return'
   36 |                 insertionSort(A, N);l
      |                                      ^
      |                                      ;
   37 | 
   38 |                 return 0;
      |                 ~~~~~~
Language: C

#include<iostream>
using namespace std;

int bubbleSort(int A[],int N){
 int sw=0;
 bool flag=1;
 for(int i=0;flag;i++){
  flag=0;
  for(int j=N-1;j>=i+1;j--){
   if(A[j]<A[j-1]){
   swap(A[j],A[j-1]);
   flag=1;
   sw++;
   }
  }
 }
 return sw;
}

int main(){
 int A[100],N,sw;
 cin >> N;
 for(int i=0;i<N;i++) cin >> A[i];

 sw=bubbleSort(A,N);
 
 for(int i=0;i<N;i++){
  if(i) 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.