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

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

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

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

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

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

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:6:7: error: expected expression before '%' token
    6 | scanf(%d,&i);
      |       ^
main.c: In function 'insertionSort':
main.c:37:8: error: returning 'int *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
   37 | return A;
      |        ^
main.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
main.c: In function 'main':
main.c:38:1: error: expected declaration or statement at end of input
Language: C

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

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

Compiler output:
main.c: In function 'main':
main.c:6:7: error: expected expression before '%' token
    6 | scanf(%d,&i);
      |       ^
main.c:14:2: error: assignment to expression with array type
   14 | n=insertionSort(n,i);
      |  ^
main.c: In function 'insertionSort':
main.c:37:8: error: returning 'int *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
   37 | return A;
      |        ^
main.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
main.c: In function 'main':
main.c:38:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

static void insertionSort(int *sortArray, int sizeOfArray);
static void displayElements(int *sortArray, int sizeOfArray);

int main(void)
{
	int array[1000];
	int sizeOfArray;
	int index;

	scanf("%d", &sizeOfArray);

	displayElements(sortArray, sizeOfArray);

	for(index = 0; index < sizeOfArray; index++){
		scanf("%d", &array[index]);
		if(array[index] < 1 || 100 < array[index]){
			fprintf(stderr, "Invalid number.");
		}
	}

	/* ?????\????????? */
	insertionSort(array, sizeOfArray);

	return 0;
}

static void insertionSort(int *sortArray, int sizeOfArray)
{
	int i;
	int j;
	int v;

	for(i = 1; i < sizeOfArray; i++){
		v = sortArray[i];
		j = i - 1;
		while(0 <= j && v < sortArray[j]){
			sortArray[j + 1] = sortArray[j];
			j--;
		}
		sortArray[j + 1] = v;

		displayElements(sortArray, sizeOfArray);
	}
}

static void displayElements(int *sortArray, int sizeOfArray)
{
	int i;

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

Compiler output:
main.c: In function 'main':
main.c:14:25: error: 'sortArray' undeclared (first use in this function)
   14 |         displayElements(sortArray, sizeOfArray);
      |                         ^~~~~~~~~
main.c:14:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <string.h>

int split(char *str, const char *delim, char *outlist[])
{
    char    *tk;
    int     cnt = 0;

    tk = strtok(str, delim);
    while(tk != NULL) {
        outlist[cnt++] = tk;
        tk = strtok(NULL, delim);
    }
    return cnt;
}

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

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

int main (int argc, char** argv)
{
    int N, i;
    char instr[2048];
    char **list;
    int numlist[100];

    memset(instr, '\0', sizeof(instr));
    memset(numlist, '\0', sizeof(numlist));

    scanf("%d", &N);
    scanf("%s", &instr);

    split(instr, ' ', list);

	for (i = 0; i < N; i++) {
		numlist[i] = atoi(list[i])
	}

	insertionSort(numlist, N);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:53:18: error: passing argument 2 of 'split' makes pointer from integer without a cast [-Wint-conversion]
   53 |     split(instr, ' ', list);
      |                  ^~~
      |                  |
      |                  int
main.c:4:34: note: expected 'const char *' but argument is of type 'int'
    4 | int split(char *str, const char *delim, char *outlist[])
      |                      ~~~~~~~~~~~~^~~~~
main.c:56:30: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   56 |                 numlist[i] = atoi(list[i])
      |                              ^~~~
main.c:56:43: error: expected ';' before '}' token
   56 |                 numlist[i] = atoi(list[i])
      |                                           ^
      |                                           ;
   57 |         }
      |         ~
Language: C

#include <stdio.h>

void print_array(int *array,int n){
  int i;

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

int main(void){
  int i,j,v.n,array[100];

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   11 |   int i,j,v.n,array[100];
      |            ^
main.c:13:15: error: 'n' undeclared (first use in this function)
   13 |   scanf("%d",&n);
      |               ^
main.c:13:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:33: error: 'array' undeclared (first use in this function)
   14 |   for(i=0;i<n;i++)  scanf("%d",&array[i]);
      |                                 ^~~~~
main.c:16:5: error: 'v' undeclared (first use in this function)
   16 |     v=array[i];
      |     ^
Language: C

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

#define MAX 1000

int main(){

  int i;
  int j;
  int A[MAX];
  int v;
  int length;
 
  scanf("%d",&N);

  if(length > 100){
    printf("too large\n");
    exit(1);
  }

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

  for(i = 1;i <= length-1;i++){

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

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

  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:14:15: error: 'N' undeclared (first use in this function)
   14 |   scanf("%d",&N);
      |               ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define 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");
}

main(){
  int i, j, n;
  int arr[N+1];
  int key;

  scanf("%d",&n);

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

  trace(arr, n);

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

  return 0;
}

Compiler output:
main.c:13:1: error: return type defaults to 'int' [-Wimplicit-int]
   13 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:30: error: invalid type argument of unary '*' (have 'int')
   27 |     while(j >= 0 && arr[j] > *key){
      |                              ^~~~
Language: C

int main(){

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

  scanf("%d",&a);

  if( a > N || a < 1 ) exit(8);

  for(i=0;i<a;i++){
    scanf("%d",&A[i]);
    if( 0 > A[i] || 1000 < A[i] ) exit(9);
  }

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

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

Compiler output:
main.c: In function 'main':
main.c:4:9: error: 'N' undeclared (first use in this function)
    4 |   int A[N];
      |         ^
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&a);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&a);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:24: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    8 |   if( a > N || a < 1 ) exit(8);
      |                        ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | int main(){
main.c:8:24: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    8 |   if( a > N || a < 1 ) exit(8);
      |                        ^~~~
main.c:8:24: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:12:35: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   12 |     if( 0 > A[i] || 1000 < A[i] ) exit(9);
      |                                   ^~~~
main.c:12:35: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:15:30: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |   for( k = 0 ; k < a ; k++ ) printf("%d ",A[k]);
      |                              ^~~~~~
main.c:15:30: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:30: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:30: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |   printf("\n");
      |   ^~~~~~
main.c:16:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

static const int N = 1000;

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

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

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

   for(i = 2;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;
    }
    trace(A,n);
  } 
  return 0;
}

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

#include<stdio.h>

#define N 100

int main()
{
  int i,j,key,n,l;
  int A[N];

  scanf("%d",&n);

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

  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;

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

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

#include<stdio.h>

int main()
{

  int n,a[1000],i,j,key,u;

  scanf("%d",&n);

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

  printf("\n");

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

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

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

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

  }

  printf("\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:17: error: 'A' undeclared (first use in this function)
   20 |   printf("%d\n",A[u]);
      |                 ^
main.c:20:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main()
{
  int N,i,j,key,k;
  int *array;

  /* 入力 */
  scanf("%d",&N);
  if(N >100 || N < 1) exit(0);
  array = (int *)malloc(sizeof(int) * N);
  if(array == NULL) exit(0);
  for(i = 0;i < N;i++){
    scanf("%d",&array[i]);
  }

   /* 出力 */
    for(k = 0;k < N;k++){
      printf("%d ",array[k]);
    }
    printf("\n");
  }
 
  /* sort */
  for(i = 0;i <= N-1;i++){
    key = array[i];
    j = i - 1;
    while(j >= 0 && array[j] > key){
      array[j+1] = array[j];
      j--;
    }
    array[j+1] = key;
    /* 出力 */
    for(k = 0;k < N;k++){
      printf("%d ",array[k]);
    }
    printf("\n");
  }

  return 0;
}

Compiler output:
main.c:26:3: error: expected identifier or '(' before 'for'
   26 |   for(i = 0;i <= N-1;i++){
      |   ^~~
main.c:26:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   26 |   for(i = 0;i <= N-1;i++){
      |               ^~
main.c:26:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   26 |   for(i = 0;i <= N-1;i++){
      |                       ^~
main.c:41:3: error: expected identifier or '(' before 'return'
   41 |   return 0;
      |   ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

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

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

#include<stdio.h>

int main(){

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

scanf();

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

Compiler output:
main.c: In function 'main':
main.c:7:1: error: too few arguments to function 'scanf'
    7 | scanf();
      | ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/stdio.h:466:12: note: declared here
  466 | extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
      |            ^~~~~~~~~~
main.c:12:7: error: expected expression before '=' token
   12 | j=i-1;=0 && A[j]>v){
      |       ^
main.c:12:19: error: expected statement before ')' token
   12 | j=i-1;=0 && A[j]>v){
      |                   ^
main.c:13:7: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   13 | A[j+1]=A
      |       ^
main.c:13:9: error: expected ';' before 'while'
   13 | A[j+1]=A
      |         ^
      |         ;
   14 | while(j>[j];
      | ~~~~~    
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
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,v;
  int A[N+1];
  scanf("%d", &n); /*Input includes an integer n*/

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);/*Input the number of elements in the sequence*/
  
  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;
    }

    for(i = 1; i <= n; i++ ) printf("%d",A[i]);
    printf("\n");

  return 0;
}

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

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

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

  scanf("%d",&N);

  if(N>=1 && N<=100) exit8;

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

 printf("\n");

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

    printf("\n");
  }
  printf("\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:22: error: 'exit8' undeclared (first use in this function)
    9 |   if(N>=1 && N<=100) exit8;
      |                      ^~~~~
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:14: error: 'num' undeclared (first use in this function)
   17 |   for(j=1; j<num; j++){
      |              ^~~
Language: C



#include <stdio.h>

#define A 1000

int main()
{
  int array[A];
  int i;
  int num;//打ち込む個数
  int v;
  int j;
  int k;

  scanf("%d",&num);

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

  for(i = 1 ; i <= num-1 ; 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 < num ; k++)
	{
	printf("%d ",array[k]);

	}
if(i<=num-1)printf("\n");
    }
 

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

#include <stdio.h>

#define A 1000

int main()
{
  int array[A];
  int i;
  int num;//打ち込む個数
  int v;
  int j;
  int k;

  scanf("%d",&num);

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

  for(i = 1 ; i <= num-1 ; 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 < num ; k++)
	{
	printf("%d ",array[k]);

	}
if(i<=num-1)printf("\n");
    }
 

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

 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;

    draw(n, a);

  }

Compiler output:
main.c:1:2: error: expected identifier or '(' before 'for'
    1 |  for(i = 1; i < n; i++){
      |  ^~~
main.c:1:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 |  for(i = 1; i < n; i++){
      |               ^
main.c:1:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 |  for(i = 1; i < n; i++){
      |                     ^~
Language: C

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;

  }

Compiler output:
main.c:1:1: error: expected identifier or '(' before 'for'
    1 | for(i = 1; i < n; i++){
      | ^~~
main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | for(i = 1; i < n; i++){
      |              ^
main.c:1:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 | for(i = 1; i < n; i++){
      |                    ^~
Language: C

#include<stdio.h>

int main(){

  int A[1000];
  int N = 0;
  int i,j,key,length;

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

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

A[j + 1] = key;

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

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:23:32: error: expected expression before '}' token
   23 |     while(j >= 0 && A[j] > key)}
      |                                ^
main.c: At top level:
main.c:31:3: error: 'j' undeclared here (not in a function)
   31 | A[j + 1] = key;
      |   ^
main.c:31:1: warning: data definition has no type or storage class
   31 | A[j + 1] = key;
      | ^
main.c:31:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:31:12: error: 'key' undeclared here (not in a function)
   31 | A[j + 1] = key;
      |            ^~~
main.c:33:3: error: expected identifier or '(' before 'for'
   33 |   for(length = 0; length < N; length++){
      |   ^~~
main.c:33:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   33 |   for(length = 0; length < N; length++){
      |                          ^
main.c:33:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   33 |   for(length = 0; length < N; length++){
      |                                     ^~
main.c:39:8: error: expected declaration specifiers or '...' before string constant
   39 | printf("\n");
      |        ^~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
main.c:43:1: error: expected identifier or '(' before 'return'
   43 | return 0;
      | ^~~~~~
main.c:45:1: error: expected identifier or '(' before '}' token
   45 | }
      | ^
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,k,v;
  int A[N+1];
  scanf("%d", &n);
 
  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
  trace(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;
     }
     for ( k = 1; k <= n; k++ ) printf("%d ", A[k]);
     printf("\n");
   }   
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:18: error: expected expression before '=' token
   21 |   for(i = 2 ;i < =n; i++){
      |                  ^
Language: C

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;

  }

Compiler output:
main.c:1:1: error: expected identifier or '(' before 'for'
    1 | for(i = 1; i < n - 1; i++){
      | ^~~
main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | for(i = 1; i < n - 1; i++){
      |              ^
main.c:1:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 | for(i = 1; i < n - 1; i++){
      |                        ^~
Language: C

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

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

Compiler output:
main.c: In function 'main':
main.c:4:2: error: stray '#' in program
    4 | {#include <stdio.h>
      |  ^
main.c:4:3: error: 'include' undeclared (first use in this function)
    4 | {#include <stdio.h>
      |   ^~~~~~~
main.c:4:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:12: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
    4 | {#include <stdio.h>
      |            ^~~~~
      |            stdin
main.c:6:1: error: expected expression before 'int'
    6 | int main()
      | ^~~
main.c:37:15: error: 'num' undeclared (first use in this function)
   37 |   scanf("%d",&num);
      |               ^~~
main.c:38:7: error: 'i' undeclared (first use in this function)
   38 |   for(i=0;i<num;i++)
      |       ^
main.c:45:7: error: 'v' undeclared (first use in this function)
   45 |       v=A[i];
      |       ^
main.c:46:7: error: 'j' undeclared (first use in this function)
   46 |       j=i-1;
      |       ^
Language: C

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

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

Compiler output:
main.c:34:9: error: expected declaration specifiers or '...' before string constant
   34 |   scanf("%d",&num);
      |         ^~~~
main.c:34:14: error: expected declaration specifiers or '...' before '&' token
   34 |   scanf("%d",&num);
      |              ^
main.c:35:3: error: expected identifier or '(' before 'for'
   35 |   for(i=0;i<num;i++)
      |   ^~~
main.c:35:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   35 |   for(i=0;i<num;i++)
      |            ^
main.c:35:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   35 |   for(i=0;i<num;i++)
      |                  ^~
main.c:40:3: error: expected identifier or '(' before 'for'
   40 |   for(i=0;i<num;i++)
      |   ^~~
main.c:40:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   40 |   for(i=0;i<num;i++)
      |            ^
main.c:40:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   40 |   for(i=0;i<num;i++)
      |                  ^~
main.c:56:3: error: expected identifier or '(' before 'return'
   56 |   return 0;
      |   ^~~~~~
main.c:57:1: error: expected identifier or '(' before '}' token
   57 | }
      | ^
Language: C

#include<stdio.h>

int main(){

  int A[1000];
  int N = 0;
  int i,j,key,length;

  scanf("%d",&N);

  for(i = 0; i < N; i++){

    scanf("%d",&A[i]);

  }

  for (i =0; i < N; i++){

    key = A[i];

    j = i - 1;

    while(j >= 0 && A[j] > key){

  A[j + 1] = A[j];

  j = j - 1;

}

A[j + 1] = key;

  for(length = 0; length <＝ N; length++){
    if(length < N)printf("%d ",A[length]);
    else printf("%d",A[length]);
   
  }

printf("\n");

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:33:27: error: '\U0000ff1d' undeclared (first use in this function)
   33 |   for(length = 0; length <＝ N; length++){
      |                           ^~
main.c:33:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:29: error: expected ';' before 'N'
   33 |   for(length = 0; length <＝ N; length++){
      |                             ^~
      |                             ;
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected expression before ';' token
    8 |   for(i=;i<N;i++){
      |         ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:19: error: stray '\343' in program
    6 |   for(i=0;i<n;i++)<U+3000>scanf("%d",&A[i]);
      |                   ^~~~~~~~
main.c:15:21: error: stray '\343' in program
   15 |     for(j=0;j<n;j++)<U+3000>printf("%d ",A[j]);
      |                     ^~~~~~~~
Language: C

#include<stdio.h>

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:17:17: error: expected ';' before 'printf'
   17 |    else(A[j]==5) printf("%d\n",A[j]);
      |                 ^~~~~~~
      |                 ;
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C


  
#include<stdio.h>

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

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

#include<stdio.h>

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

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

#include <stdio.h>

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

  scanf("%d",&N);
  
  for(i=0;i<N;i++){
    scanf("%d",&A[i]); //input number
    printf("%d",A[i]); //output number
    if(i != N-1) printf(" "); 
  }
  printf("\n");
  
  for(i=1;i<N;i++){　//insert A[i] into the soted sequence
    v = A[i]; 
    j = i-1;
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v; 
    for(q=0;q<N;q++){
      printf("%d",A[q]); 
      if(q != N-1) printf(" ");
    }
    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:20: error: stray '\343' in program
   17 |   for(i=1;i<N;i++){<U+3000>//insert A[i] into the soted sequence
      |                    ^~~~~~~~
Language: C

#include <stdio.h>
int main(){
  int n,j,i,k,v;
  int A[LIMN];
  scanf("%d",&n);
  for(j=0;j<n;j++){
    scanf("%d",&A[j]);
  }
  for(i=1;i<=n-1;i++){
    v=A[i];
    j=i-1;
    while(j>=0 && A[j]>v){
      for(k=0;k<n;k++){
	printf("%d ",A[k]);
      }
      printf("\n");
      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: In function 'main':
main.c:4:9: error: 'LIMN' undeclared (first use in this function)
    4 |   int A[LIMN];
      |         ^~~~
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C


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

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

v=A[i];
  j=i-1;

  while(j >=0 && A[j] > v){
    A[j+1]=A

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&N);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&N);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |       printf("%d ",A[v]);
      |       ^~~~~~
main.c:14:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 | printf("\n");
      | ^~~~~~
main.c:16:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:11: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   22 |     A[j+1]=A
      |           ^
main.c:22:13: error: expected ';' at end of input
   22 |     A[j+1]=A
      |             ^
      |             ;
main.c:22:5: error: expected declaration or statement at end of input
   22 |     A[j+1]=A
      |     ^
main.c:22:5: error: expected declaration or statement at end of input
main.c:22:5: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main(){
  
  int N,A[100],i,j,v,k;
  
  scanf("%d",&N);
  
  for(i=0; i < N; i++){
    scanf("%d",&A[i]);
  }

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

v=A[i];
  j=i-1;

  while(j >=0 && A[j] > v){
    A[j+1]=A

Compiler output:
main.c: In function 'main':
main.c:22:11: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   22 |     A[j+1]=A
      |           ^
main.c:22:13: error: expected ';' at end of input
   22 |     A[j+1]=A
      |             ^
      |             ;
main.c:22:5: error: expected declaration or statement at end of input
   22 |     A[j+1]=A
      |     ^
main.c:22:5: error: expected declaration or statement at end of input
main.c:22:5: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>

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

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

v=A[i];
  j=i-1;

  while(j >=0 && A[j] > v){
    A[j+1]=A 
}
  }
 
  return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:23:11: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   23 |     A[j+1]=A
      |           ^
main.c:23:13: error: expected ';' before '}' token
   23 |     A[j+1]=A
      |             ^
      |             ;
   24 | }
      | ~
Language: C

#include <stdio.h>

int main(int argc, char *argv[])
{
  char row[4];
  int n = atoi(fgets(row, sizeof(row), stdin));
  int arr[n];

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
    6 |   int n = atoi(fgets(row, sizeof(row), stdin));
      |           ^~~~
Language: C

#include <stdio.h>

void insertionSort(int arr[], int n)
{
  int i, j, k;
  int key;

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

int main(int argc, char *argv[])
{
  char row[4];
  int n = atoi(fgets(row, sizeof(row), stdin));
  int arr[n];
  int i;

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

  insertionSort(arr, n);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:11: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   26 |   int n = atoi(fgets(row, sizeof(row), stdin));
      |           ^~~~
Language: C

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

int main()
{
        int array[100], array_num = 0, count = 0, count_in = 0;
        int key, output_count = 0;

        scanf("%d", &array_num);
        while ( count < array_num )
        {
                scanf("%d", &array[count]);
                count = count + 1;
        }

        for ( count = 1 ; count < array_num ; count = count + 1 )
        {
                key = array[count];
                while ( output_count < array_num )
                {
                        if ( output_count == array_num - 1 )
                        {
                                printf("%d\n", array[output_count]);
                        }
                        else
                        {
                                printf("%d ", array[output_count]);
                        }
                        output_count = output_count + 1;
                }

                count_in = count - 1;
                while (( count_in >= 0 ) && ( array[count_in] > key ))
                {
                        array[count_in + 1] = array[count_in];
                        count_in = count_in - 1;
                }
                array[count_in + 1] = key;

                output_count = 0;
        }

        while ( output_count < array_num )
        {
                if ( output_count == array_num - 1 )
                {
                        printf("%d\n", array[output_count]);
                }
                else
                {
                        printf("%d ", array[output_count]);
                }
                output_count = output_count + 1;
        }

        return 0;
}
u

Compiler output:
main.c:58:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   58 | u
      | ^
Language: C

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

Compiler output:
/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 insertionSort(int A[], int N);
int main(void){
    int n[100];
    int i, r;
    scanf("%d", &i);
    for (r = 0; r < i; r++){
        scanf("%d", &n[r]);
    }
    for (r = 0; r < i; r++){
        if (r != i - 1){ printf("%d ", n[r]); }
        else{
            printf("%d\n", n[r]);
        }
    }
    insertionSort(n, i);
 
    return 0;
}
    void insertionSort(int A[], int N){
        int i, j, v, r;
        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 (r = 0; r < N; r++){
                if (r != N - 1){ printf("%d ", A[r]); }
                else{
                    printf("%d\n", A[r]);
                }
            }
 
        }
        return;
    

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

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

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

int main(void)
{
	char str[1000] = {};
	char *s2 = " ";
	char *tok;

	int num = 0;
	int str_cnt = 0;
	int array_i[1000] = {};

	fgets(str, sizeof(str), stdin);
	num = atoi(str);
	if (num < 1 || num > 100)return -1;

	fgets(str, sizeof(str), stdin);
	tok = strtok(str, s2);
	array_i[str_cnt] = atoi(tok);
	if (array_i[str_cnt] < 1 || array_i[str_cnt]  > 1000)return -1;
	str_cnt++;

	while (tok != NULL) {
		tok = strtok(NULL, s2);
		if (tok != NULL) {
			array_i[str_cnt] = atoi(tok);
			if (array_i[str_cnt] < 1 || array_i[str_cnt]  > 1000)return -1;
			str_cnt++;
		}
	}
	
	trace(array_i, num);
	insertionSort(array_i, num);

	//for (int i = 0; i < num; i++) {
	//	printf("%d ", array_i[i]);
	//}

	//printf("\n");

	return 0;

}

Compiler output:
main.c: In function 'trace':
main.c:8:25: error: expected ')' before 'printf'
    8 |                 if((i>0)printf(" ");
      |                   ~     ^~~~~~
      |                         )
main.c:10:9: error: expected expression before '}' token
   10 |         }
      |         ^
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:9:17: error: expected ';' before '}' token
    9 |     printf("\n")
      |                 ^
      |                 ;
   10 | }
      | ~
Language: C

#include static const int N = 1000; void trace(int A[], int n){ int i; for ( i = 1; i <= n; i++ ){ if ( i > 1 ) printf(" "); printf("%d", A[i]); } printf("\n"); } int main(){ int n, i, j; int A[N+1]; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]); trace(A, n); /* your code */ return 0; } 

Compiler output:
main.c:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include static const int N = 1000; void trace(int A[], int n){ int i; for ( i = 1; i <= n; i++ ){ if ( i > 1 ) printf(" "); printf("%d", A[i]); } printf("\n"); } int main(){ int n, i, j; int A[N+1]; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]); trace(A, n); /* your code */ return 0; }
      |          ^~~~~~
Language: C

#include<stdio.h>

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

void trace(int A[],int N){
	for(int i=0;i < N;i++)
	{

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

void main(){
	int N,i;
	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:9:25: warning: comparison between pointer and integer
    9 |                 while(j >= && A[j]>v)
      |                         ^~
main.c:9:32: error: expected ')' before '[' token
    9 |                 while(j >= && A[j]>v)
      |                      ~         ^
      |                                )
main.c:15:17: error: implicit declaration of function 'trace' [-Wimplicit-function-declaration]
   15 |                 trace(A,N);
      |                 ^~~~~
main.c:9:17: error: label 'A' used but not defined
    9 |                 while(j >= && A[j]>v)
      |                 ^~~~~
main.c: At top level:
main.c:19:6: warning: conflicting types for 'trace'; have 'void(int *, int)'
   19 | void trace(int A[],int N){
      |      ^~~~~
main.c:15:17: note: previous implicit declaration of 'trace' with type 'void(int *, int)'
   15 |                 trace(A,N);
      |                 ^~~~~
main.c: In function 'main':
main.c:38:16: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   38 |         return 0;
      |                ^
main.c:30:6: note: declared here
   30 | void main(){
      |      ^~~~
Language: C

#include <stdio.h>

int N;
int A[1000];

int insertion(int a[], int b);
int print(int d[], int c);

int main(){

	int i = 0;
   
	scanf_s("%d", &N);

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

	insertion(A, N);



}

int insertion(int a[], int b){
	int v;
	int i;
	int j;
	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;

		print(A,b);

	}

	return 0;

}

int print(int d[], int c){
	int i = 0;
	for (i = 0; i < c; i++){
		printf("%d ", d[i]);
	}
	printf("\n");
	return 0;
}

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