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)print("");
    printf("%d",A[i]);
  }
  printf("\n");
}
    
void insertionSort(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++);
   
  trace(A,N);
  insertionSort(A,N);

  return 0;
}
  



Compiler output:
main.c: In function 'trace':
main.c:6:12: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |     if(i>0)print("");
      |            ^~~~~
      |            printf
Language: C

#include<stdio.h>

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

  return 0;
}
  



Compiler output:
main.c: In function 'trace':
main.c:6:12: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |     if(i>0)print(" ");
      |            ^~~~~
      |            printf
Language: C

#include<stdio.h>

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

  return 0;
}
  



Compiler output:
main.c: In function 'trace':
main.c:6:12: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |     if(i>0)print(" ");
      |            ^~~~~
      |            printf
Language: C

#include <stdio.h>
#include <string.h>
#define N 5
void insertionSort(int *,int);
int main (){
  scanf("",&b);
  insertionSort(,N);

  return 0;
}

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

}



Compiler output:
main.c: In function 'main':
main.c:6:13: error: 'b' undeclared (first use in this function)
    6 |   scanf("",&b);
      |             ^
main.c:6:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:17: error: expected expression before ',' token
    7 |   insertionSort(,N);
      |                 ^
main.c: In function 'insertionSort':
main.c:13:13: error: expected identifier or '(' before ';' token
   13 |   int i,j,v,;
      |             ^
main.c:15:9: error: 'A' undeclared (first use in this function)
   15 |     v = A[i];
      |         ^
Language: C

#include <stdio.h>

int main(void)
{
 
  int i, j, tmp, tate, N;
 
  /* 数値を格納する配列 */
  int number[100];
 
  /* 数値の総数を入力 */
  int total;
  scanf("%d", &N);
  scanf("%d",&su);
 
  /* 配列に格納する数値を入力 */
  printf("%d個の数値を入力 \n", total);
  for (i=0; i<total; ++i)
    scanf("%d", &number[i]);
 
  /* 数値を昇順にソート */
  for (i=0; i<total; ++i) {
    for (j=i+1; j<total; ++j) {
      if (number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
 
  /* 昇順ソートした数値を出力 */
  printf("昇順ソートした数値\n");
  for (i=0; i<total; ++i)
    printf("%d\n", number[i]);
}



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

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



Compiler output:
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    8 |   print(A,n);
      |   ^~~~~
      |   printf
main.c:17:7: error: implicit declaration of function 'printt'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |       printt(A,n);
      |       ^~~~~~
      |       printf
main.c: At top level:
main.c:21:6: warning: conflicting types for 'print'; have 'void(int *, int)'
   21 | void print(int A[],int n){
      |      ^~~~~
main.c:8:3: note: previous implicit declaration of 'print' with type 'void(int *, int)'
    8 |   print(A,n);
      |   ^~~~~
Language: C

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



sshsv171:le01 


Compiler output:
main.c:33:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   33 | sshsv171:le01
      |         ^
Language: C

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

int main(){
  int {i,data,V,j} = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int));
  for(i = 0 ; i++ ; i < data){
  scanf("%d",insert[i]);
  }

  for(i = 1; i++ ; i <= data-1){
  V = insert[i];
  j = i - 1;

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



Compiler output:
main.c: In function 'main':
main.c:5:7: error: expected identifier or '(' before '{' token
    5 |   int {i,data,V,j} = 0;
      |       ^
main.c:5:20: error: expected expression before '=' token
    5 |   int {i,data,V,j} = 0;
      |                    ^
main.c:8:15: error: 'data' undeclared (first use in this function)
    8 |   scanf("%d",&data);
      |               ^~~~
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:7: error: 'i' undeclared (first use in this function)
   10 |   for(i = 0 ; i++ ; i < data){
      |       ^
main.c:15:3: error: 'V' undeclared (first use in this function)
   15 |   V = insert[i];
      |   ^
main.c:16:3: error: 'j' undeclared (first use in this function)
   16 |   j = i - 1;
      |   ^
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int *A;
  int k=0,i=0,j=0,v=0,a,c=0,size;

  scanf("%d",&size);//size of array
  A = (int *)malloc(size * sizeof(int)); // memory

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

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

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



Compiler output:
main.c: In function 'main':
main.c:18:20: error: expected ';' before 'printf'
   18 |   printf("%d",A[k])
      |                    ^
      |                    ;
   19 |   printf("\n");
      |   ~~~~~~
Language: C

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

int main(){
  int i = 0;
  int data = 0;
  int V = 0;
  int j = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int));
for(i = 0 ; i < data ; i++){
scanf("%d",&insert[i]);
}

for(i = 1; i <= data-1 ; i++){
  V = insert[i];
  j = i - 1;

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



Compiler output:
main.c: In function 'main':
main.c:32:7: error: stray '\343' in program
   32 | return<U+3000>0;
      |       ^~~~~~~~
Language: C

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

int main(){
  int i = 0;
  int data = 0;
  int V = 0;
  int j = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int));
for(i = 0 ; i < data ; i++){
scanf("%d",&insert[i]);
}

for(i = 1; i <= data-1 ; i++){
  V = insert[i];
  j = i - 1;

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



Compiler output:
main.c: In function 'main':
main.c:32:7: error: stray '\343' in program
   32 | return<U+3000>0;
      |       ^~~~~~~~
Language: C

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

int main(){
  int i = 0;
  int data = 0;
  int V = 0;
  int j = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int));
for(i = 0 ; i < data ; i++){
scanf("%d",&insert[i]);
}

for(i = 1; i <= data-1 ; i++){
  V = insert[i];
  j = i - 1;

  while(j >= 0 && insert[j] > V){
    insert[j + 1] = insert[j];
    j--;
    insert[j + 1] = V;
  }
}

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



Compiler output:
main.c: In function 'main':
main.c:32:7: error: stray '\343' in program
   32 | return<U+3000>0;
      |       ^~~~~~~~
Language: C

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

int main(){
  int i = 0;
  int data = 0;
  int V = 0;
  int j = 0;
  int *insert;

  scanf("%d",&data);
  insert = (int *)malloc(sizeof(int)*data);
 
for(i = 0 ; i < data ; i++){
scanf("%d",&insert[i]);
}

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

for(i = 1; i <= data-1 ; i++){
  V = insert[i];
  j = i - 1;

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

return 0;
}



Compiler output:
main.c:41:8: error: expected declaration specifiers or '...' before string constant
   41 | printf("%d",insert[0]);
      |        ^~~~
main.c:41:13: error: unknown type name 'insert'
   41 | printf("%d",insert[0]);
      |             ^~~~~~
main.c:42:1: error: expected identifier or '(' before 'for'
   42 | for(i = 1 ; i < data ;i++){
      | ^~~
main.c:42:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   42 | for(i = 1 ; i < data ;i++){
      |               ^
main.c:42:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   42 | for(i = 1 ; i < data ;i++){
      |                        ^~
main.c:46:1: error: expected identifier or '(' before 'return'
   46 | return 0;
      | ^~~~~~
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C

package ex1;
import java.util.Scanner;
public class GreatestCommonDivisor {
public static void main(String[] args){
	int z;
	Scanner scanner=new Scanner(System.in);
	int x = scanner.nextInt();
	int y = scanner.nextInt();
	while(true){
		z=x%y;
		if(z==0){
			System.out.println(y);
			break;
		}
		else{
			x=y;
			y=z;
		}
	}
}
}



Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package ex1;
      | ^~~~~~~
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class GreatestCommonDivisor {
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GreatestCommonDivisor'
    3 | public class GreatestCommonDivisor {
      |              ^~~~~~~~~~~~~~~~~~~~~
Language: C


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

int main(int argc, char** argv) {

    
    FILE *fin;
    FILE *fout;
    
    int length;
    fin = fopen("input.txt", "rt");
    
    fscanf( fin, "%d", &length );
    
    int A[];
    int i;
    
    for(int i=0;i<length;i++)
    {
        fscanf(fin, "%d", &A[i]);
    }
    fclose(fin);
        
    fout = fopen("output.txt", "wt");
    
    int key;
    int j;
    
    for(i=0; i<length; i++){
        key = A[i];
        
        for(j=i; j>0 && A[j-1]>key; j--)
            A[j]=A[j-1];
        
        A[j]=key;
        
        for(int n=0; n<length; n++){
            fprintf(fout, "%d ", A[n]);
        }
        fprintf(fout, "\n");      
    }
    fclose(fout);
    
    return (EXIT_SUCCESS);
}




Compiler output:
main.c: In function 'main':
main.c:16:9: error: array size missing in 'A'
   16 |     int A[];
      |         ^
Language: C


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

int main(int argc, char** argv) {

    
    FILE *fin;
    FILE *fout;
    
    int length;
    fin = fopen("input.txt", "rt");
    
    fscanf( fin, "%d", &length );
    
    int i;
    int A[];
    
    for(i=0;i<length;i++)
    {
        fscanf(fin, "%d", &A[i]);
    }
    fclose(fin);
        
    fout = fopen("output.txt", "wt");
    
    int key;
    int j;
    
    for(i=0; i<length; i++){
        key = A[i];
        
        for(j=i; j>0 && A[j-1]>key; j--)
            A[j]=A[j-1];
        
        A[j]=key;
        
        for(int n=0; n<length; n++){
            fprintf(fin, "%d ", A[n]);
        }
        fprintf(fin, "\n");      
    }
    fclose(fout);
    
    return (EXIT_SUCCESS);
}




Compiler output:
main.c: In function 'main':
main.c:17:9: error: array size missing in 'A'
   17 |     int A[];
      |         ^
Language: C

import java.util.Scanner;
public class Main{

private static Scanner scanner;

public static void main(String args[])
{
	scanner = new Scanner(System.in);
	int a = scanner.nextInt();
	int[] b = new int[a];
	for(int i = 0;i < a;i++) {
		b[i] = scanner.nextInt();

	}
	for(int i = 0;i < a;i++) {
		int v = b[i];
		int j = i-1;
		while(j >= 0 && b[j] > v) {
			b[j+1] = b[j];
			j--;
			b[j+1] = v;
		}
		for(int c = 0;c < a;c++)
		{
			System.out.print(b[c]);
		}
		System.out.println("");
		}

	}
}



Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'public'
    2 | public class Main{
      | ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    2 | public class Main{
      |              ^~~~
Language: C

#include <stdio.h>

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

  scanf("%d",&N);

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

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

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




Compiler output:
main.c:29:3: error: expected identifier or '(' before 'for'
   29 |   for(k=0;k<N-1;k++){
      |   ^~~
main.c:29:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   29 |   for(k=0;k<N-1;k++){
      |            ^
main.c:29:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   29 |   for(k=0;k<N-1;k++){
      |                  ^~
main.c:32:11: error: expected declaration specifiers or '...' before string constant
   32 |    printf("%d\n",A[k]);
      |           ^~~~~~
main.c:32:18: error: unknown type name 'A'
   32 |    printf("%d\n",A[k]);
      |                  ^
main.c:33:3: error: expected identifier or '(' before 'return'
   33 |   return 0;
      |   ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define LIMIT 100

void printArray(int[],int);

int main(int argc, char** argv) {
    int count;
    int error = 0;
    
    int checkScan = scanf("%d", &count);
    if(checkScan != 1)
        return (EXIT_FAILURE);
    const int arraySize = count;
    int array[arraySize];
    
    if(count > LIMIT || count < 1)
        return(EXIT_FAILURE);
    
    int chkScan;
    for(int i = 0; i < count; i++){
        chkScan = scanf("%d", &array[i++]);
        if(chkScan != 1)
            return(EXIT_FAILURE);
    }
    
    for(i = 0; i < count; i++){
        int temp = array[i];
        int j = i - 1;
        while(j >= 0 && array[j] > temp)
            array[j+1] = array[j--];
        array[j+1] = temp;
        printArray(array, count);
    }
    
    free(array);
    return (EXIT_SUCCESS);
}

void printArray(int array[], int count){
    for(int i = 0; i < count; i++){
        if(array[i]!=NULL && i != count - 1)
            printf("%d ", array[i]);
        else if(i == count - 1)
            printf("%d", array[i]);
    }
    printf("\n");
}



Compiler output:
main.c: In function 'main':
main.c:27:9: error: 'i' undeclared (first use in this function)
   27 |     for(i = 0; i < count; i++){
      |         ^
main.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'printArray':
main.c:42:20: warning: comparison between pointer and integer
   42 |         if(array[i]!=NULL && i != count - 1)
      |                    ^~
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 instertionSort(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 'instertionSort':
main.c:22:11: error: expected ')' before ';' token
   22 | trace(A, N;
      |      ~    ^
      |           )
main.c:22:12: error: expected ';' before '}' token
   22 | trace(A, N;
      |            ^
      |            ;
   23 | }
      | ~           
main.c: In function 'main':
main.c:35:1: error: implicit declaration of function 'insertionSort'; did you mean 'instertionSort'? [-Wimplicit-function-declaration]
   35 | insertionSort(A, N);
      | ^~~~~~~~~~~~~
      | instertionSort
Language: C

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

int main(int argc, char** argv) {
    int length;
    
    scanf("%d", &length );
    
    int i;
    int A[100];
    
    for(i=0;i<length;i++)
    {
        scanf(%d", &A[i]);
    }
    
    int key;
    int j;
    
    for(i=0; i<length; i++){
        key = A[i];
        
        for(j=i; j>0 && A[j-1]>key; j--){
            A[j]=A[j-1];
        }
        A[j]=key;
        
        for(int n=0; n<length; n++){
            printf("%d", A[n]);
            if(n!=length-1)
                printf(" ");
            else if(i!=length-1){
                printf("\n");
            }     
        }
    } 
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:15: error: expected expression before '%' token
   14 |         scanf(%d", &A[i]);
      |               ^
main.c:14:17: warning: missing terminating " character
   14 |         scanf(%d", &A[i]);
      |                 ^
main.c:14:17: error: missing terminating " character
   14 |         scanf(%d", &A[i]);
      |                 ^~~~~~~~~~
main.c:14:17: error: expected ';' before '}' token
   14 |         scanf(%d", &A[i]);
      |                 ^
      |                 ;
   15 |     }
      |     ~
Language: C

#include <stdio.h>

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

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


Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected expression before '/' token
   11 |         /
      |         ^
Language: C

#include<stdio.h>
int main(){
    int A[10];
    int a,n,s;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a);
        A[i] = a;
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
           if(A[i]>A[j]){
               s = A[i];
               A[i] = A[j];
               A[j] = s;
           }
    }
    }
    for(i=0;i<n;i++)
    printf(" %d",A[i]);
    return 0;
}


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

#include <stdio.h>
#include <stdlib.h>
int main() {
  int i,j,v;
  int N;
  int *array;

  scanf("%d",&N);
  if(N<1 || N>100) break;
  array = (int*)malloc(N*sizeof(int));
  for(i=0;i<N;i++)
    {
      scanf("%d",&array[i]);
      if(array[i]<0 || A>1000) break;
    }
  printf("\n");
  for(j=0;j<N;j++)
    {
      printf("%d ",array[j]);
    }
  printf("\n");
  for(i=1;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;
	}
      for(j=0;j<N;j++)
	{
	  printf("%d ",array[j]);
	}
      printf("\n");
    }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:20: error: break statement not within loop or switch
    9 |   if(N<1 || N>100) break;
      |                    ^~~~~
main.c:14:24: error: 'A' undeclared (first use in this function)
   14 |       if(array[i]<0 || A>1000) break;
      |                        ^
main.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:14:16: error: expected ')' before 'A'
   14 |   printf("%d\n"A[i+1]);
      |         ~      ^
      |                )
main.c:27:18: error: expected ')' before 'A'
   27 |     printf("%d\n"A[l+1]);
      |           ~      ^
      |                  )
Language: C

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



Compiler output:
main.c:35:2: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   35 |  i
      |  ^
Language: C

#include <stdio.h>

int main(){
  int i;
  int length;
  scanf("%d",&length);

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

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

  
  int c;
  /*insertion sort start*/
  int v;
  int j;
  for(i = 1 ; i < length ; i++){
    int v = A[i];
    int j = i - 1;
    while (j >= 0){
      if(A[j] < v)break;
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;

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



  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:13:7: error: 'c' undeclared (first use in this function)
   13 |   for(c = 0 ; c < length ; c++){
      |       ^
main.c:13:7: 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 i,j;
    int key;
    int n;
    int *array;
    
    scanf("%d",&n);
    array = (int n)malloc(n * sizeof(int));
    
    for(i=0;i<n;i++) {
        scanf("%d",&array[i]);
    }
    
    for(j=1;j<n;j++) {
    //printf("check");
    key = array[j];
    i=j-1;
    for(i=j-1;i>=0;i--) {
      if(array[i+1]<array[i]) {
        array[i+1] = array[i];
        array[i] = key;
      }
    }

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


Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected ')' before 'n'
   11 |     array = (int n)malloc(n * sizeof(int));
      |             ~   ^~
      |                 )
main.c:11:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   11 |     array = (int n)malloc(n * sizeof(int));
      |             ^
main.c:11:11: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   11 |     array = (int n)malloc(n * sizeof(int));
      |           ^
Language: C

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

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

  scanf("%d",&n);
  if(n<1 || n>100) exite(2);
  for(i=0; i<n; i++){
    scanf("%d",&A[i]);
  }

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

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



Compiler output:
main.c: In function 'main':
main.c:10:20: error: implicit declaration of function 'exite'; did you mean 'exit'? [-Wimplicit-function-declaration]
   10 |   if(n<1 || n>100) exite(2);
      |                    ^~~~~
      |                    exit
Language: C

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

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

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


return 0;
}



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

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

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

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


Compiler output:
main.c: In function 'main':
main.c:6:6: error: lvalue required as left operand of assignment
    6 | for(1=0 ; 1<N ; i++)(
      |      ^
main.c:7:19: error: expected ')' before ';' token
    7 | scanf("%d",&A [i]);
      |                   ^
      |                   )
main.c:6:21: note: to match this '('
    6 | for(1=0 ; 1<N ; i++)(
      |                     ^
main.c:13:2: error: stray '\342' in program
   13 | j<U+2014>;
      |  ^~~~~~~~
main.c:21:10: error: expected ';' before '}' token
   21 | return 0;
      |          ^
      |          ;
   22 | }
      | ~
Language: C

#include <stdio.h>
#include <math.h>
int judge(int);
int main(){
  int A[10000],i,j,n,cnt=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    }
  for(i=0;i<n;i++){
    if (judge(A[i])==1)cnt++;
    }
  printf("%d\n",cnt);
  return 0;
}

int judge(int x){
  int i;
  if(x<2)return 0;
  if(x==2)return 1;
  if(x%2==0)return 0;
  
  for(i=3;i<math.Sqrt(x);i+=2){
    if(x%i==0)return 0;
  }
  return 1;
    }



Compiler output:
main.c: In function 'judge':
main.c:23:13: error: 'math' undeclared (first use in this function)
   23 |   for(i=3;i<math.Sqrt(x);i+=2){
      |             ^~~~
main.c:23:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

/* 配列の要素を順番に出力 */
void trace(int A[], int N) {
  int i;
  for (i = 0; i < N; i++) {
    if (i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

/* 挿入ソート (0オリジン) */　
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:13:29: error: stray '\343' in program
   13 | /* <U+633F><U+5165><U+30BD><U+30FC><U+30C8> (0<U+30AA><U+30EA><U+30B8><U+30F3>) */<U+3000>
      |                                                                                   ^~~~~~~~
main.c: In function 'insertionSort':
main.c:16:25: error: expected ';' before ')' token
   16 |   for (i = 1, i < N; i++) {
      |                         ^
      |                         ;
main.c: In function 'main':
main.c:33:25: error: expected ';' before ')' token
   33 |   for (i = 0; i < N, i++) scanf("%d", &A[i]);
      |                         ^
      |                         ;
main.c:36:22: error: expected ';' before 'return'
   36 |   insertionSort(A, N)
      |                      ^
      |                      ;
   37 | 
   38 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>

/* 配列の要素を順番に出力 */
void trace(int A[], int N) {
  int i;
  for (i = 0; i < N; i++) {
    if (i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

/* 挿入ソート (0オリジン) */
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:16:25: error: expected ';' before ')' token
   16 |   for (i = 1, i < N; i++) {
      |                         ^
      |                         ;
main.c: In function 'main':
main.c:33:25: error: expected ';' before ')' token
   33 |   for (i = 0; i < N, i++) scanf("%d", &A[i]);
      |                         ^
      |                         ;
main.c:36:22: error: expected ';' before 'return'
   36 |   insertionSort(A, N)
      |                      ^
      |                      ;
   37 | 
   38 |   return 0;
      |   ~~~~~~
Language: C

#include<stdio.h>

/* 配列の要素を順番に出力 */
void trace(int A[], int N) {
  int i;
  for (i = 0; i < N; i++) {
    if (i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

/* 挿入ソート (0オリジン) */
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:16:25: error: expected ';' before ')' token
   16 |   for (i = 1, i < N; i++) {
      |                         ^
      |                         ;
main.c: In function 'main':
main.c:33:25: error: expected ';' before ')' token
   33 |   for (i = 0; i < N, i++) scanf("%d", &A[i]);
      |                         ^
      |                         ;
Language: C

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


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

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

void IS(int A[],int N[]){
	int j,i,v;
	for (i = 1;Ii< 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;
	int A[100];
	scanf("%d",&N);
	for (i = 0;I < N;i++){
		scanf("%d",&A[i]);
	}
	
	trace(A,N);
	IS(A,N)
	
	return 0;
}


Compiler output:
main.c: In function 'trace':
main.c:4:22: warning: comparison between pointer and integer
    4 |         for (i = 0;i < N;i++){
      |                      ^
main.c: In function 'IS':
main.c:15:20: error: 'Ii' undeclared (first use in this function); did you mean 'i'?
   15 |         for (i = 1;Ii< N;i++){
      |                    ^~
      |                    i
main.c:15:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:34: error: 'a' undeclared (first use in this function)
   19 |                         A[j+1] = a[j];
      |                                  ^
main.c: In function 'main':
main.c:31:20: error: 'I' undeclared (first use in this function)
   31 |         for (i = 0;I < N;i++){
      |                    ^
main.c:35:17: error: passing argument 2 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   35 |         trace(A,N);
      |                 ^
      |                 |
      |                 int
main.c:2:24: note: expected 'int *' but argument is of type 'int'
    2 | void trace(int A[],int N[]){
      |                    ~~~~^~~
main.c:36:14: error: passing argument 2 of 'IS' makes pointer from integer without a cast [-Wint-conversion]
   36 |         IS(A,N)
      |              ^
      |              |
      |              int
main.c:13:21: note: expected 'int *' but argument is of type 'int'
   13 | void IS(int A[],int N[]){
      |                 ~~~~^~~
main.c:36:16: error: expected ';' before 'return'
   36 |         IS(A,N)
      |                ^
      |                ;
   37 | 
   38 |         return 0;
      |         ~~~~~~
Language: C

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

void IS(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(void){
	int N,i;
	int A[100];
	scanf("%d",&N);
	for (i = 0;I < N;i++){
		scanf("%d",&A[i]);
	}
	
	trace(A,N);
	IS(A,N)
	
	return 0;
}


Compiler output:
main.c: In function 'trace':
main.c:4:22: warning: comparison between pointer and integer
    4 |         for (i = 0;i < N;i++){
      |                      ^
main.c: In function 'IS':
main.c:15:21: warning: comparison between pointer and integer
   15 |         for (i = 1;i< N;i++){
      |                     ^
main.c:19:34: error: 'a' undeclared (first use in this function)
   19 |                         A[j+1] = a[j];
      |                                  ^
main.c:19:34: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:31:20: error: 'I' undeclared (first use in this function)
   31 |         for (i = 0;I < N;i++){
      |                    ^
main.c:35:17: error: passing argument 2 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   35 |         trace(A,N);
      |                 ^
      |                 |
      |                 int
main.c:2:24: note: expected 'int *' but argument is of type 'int'
    2 | void trace(int A[],int N[]){
      |                    ~~~~^~~
main.c:36:14: error: passing argument 2 of 'IS' makes pointer from integer without a cast [-Wint-conversion]
   36 |         IS(A,N)
      |              ^
      |              |
      |              int
main.c:13:21: note: expected 'int *' but argument is of type 'int'
   13 | void IS(int A[],int N[]){
      |                 ~~~~^~~
main.c:36:16: error: expected ';' before 'return'
   36 |         IS(A,N)
      |                ^
      |                ;
   37 | 
   38 |         return 0;
      |         ~~~~~~
Language: C

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

void IS(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(void){
	int N,i;
	int A[100];
	scanf("%d",&N);
	for (i = 0;I < N;i++){
		scanf("%d",&A[i]);
	}
	
	trace(A,N);
	IS(A,N)
	
	return 0;
}


Compiler output:
main.c: In function 'trace':
main.c:4:22: warning: comparison between pointer and integer
    4 |         for (i = 0;i < N;i++){
      |                      ^
main.c: In function 'IS':
main.c:15:21: warning: comparison between pointer and integer
   15 |         for (i = 1;i< N;i++){
      |                     ^
main.c: In function 'main':
main.c:31:20: error: 'I' undeclared (first use in this function)
   31 |         for (i = 0;I < N;i++){
      |                    ^
main.c:31:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:17: error: passing argument 2 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   35 |         trace(A,N);
      |                 ^
      |                 |
      |                 int
main.c:2:24: note: expected 'int *' but argument is of type 'int'
    2 | void trace(int A[],int N[]){
      |                    ~~~~^~~
main.c:36:14: error: passing argument 2 of 'IS' makes pointer from integer without a cast [-Wint-conversion]
   36 |         IS(A,N)
      |              ^
      |              |
      |              int
main.c:13:21: note: expected 'int *' but argument is of type 'int'
   13 | void IS(int A[],int N[]){
      |                 ~~~~^~~
main.c:36:16: error: expected ';' before 'return'
   36 |         IS(A,N)
      |                ^
      |                ;
   37 | 
   38 |         return 0;
      |         ~~~~~~
Language: C

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

void IS(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(void){
	int N,i;
	int A[100];
	scanf("%d",&N);
	for (i = 0;i < N;i++){
		scanf("%d",&A[i]);
	}
	
	trace(A,N);
	IS(A,N)
	
	return 0;
}


Compiler output:
main.c: In function 'trace':
main.c:4:22: warning: comparison between pointer and integer
    4 |         for (i = 0;i < N;i++){
      |                      ^
main.c: In function 'IS':
main.c:15:21: warning: comparison between pointer and integer
   15 |         for (i = 1;i< N;i++){
      |                     ^
main.c: In function 'main':
main.c:35:17: error: passing argument 2 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   35 |         trace(A,N);
      |                 ^
      |                 |
      |                 int
main.c:2:24: note: expected 'int *' but argument is of type 'int'
    2 | void trace(int A[],int N[]){
      |                    ~~~~^~~
main.c:36:14: error: passing argument 2 of 'IS' makes pointer from integer without a cast [-Wint-conversion]
   36 |         IS(A,N)
      |              ^
      |              |
      |              int
main.c:13:21: note: expected 'int *' but argument is of type 'int'
   13 | void IS(int A[],int N[]){
      |                 ~~~~^~~
main.c:36:16: error: expected ';' before 'return'
   36 |         IS(A,N)
      |                ^
      |                ;
   37 | 
   38 |         return 0;
      |         ~~~~~~
Language: C

include <stdio.h>

void trace(int A[], int N){
	int i;
	for(i=0; i<N; i++){
		if(i>0)
			putchar(' ');
		printf("%d", A[i]);
	}
	putchar('\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:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'insertionSort':
main.c:23:17: error: implicit declaration of function 'trace' [-Wimplicit-function-declaration]
   23 |                 trace(A, N);
      |                 ^~~~~
main.c: In function 'main':
main.c:31:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   31 |         scanf("%d", &N);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:31:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   31 |         scanf("%d", &N);
      |         ^~~~~
main.c:31:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

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




Compiler output:
main.c: In function 'main':
main.c:8:22: error: expected ';' before 'for'
    8 |     printf("%d",A[i])
      |                      ^
      |                      ;
    9 |     for(j=0;j<n-1;j++) printf(" ");
      |     ~~~
Language: C

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

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

  scanf("%d",&n);

  a=(int)malloc(n*sizeof(int));

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

    printf("\n");
  }

  free(a);

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:10:5: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   10 |   a=(int)malloc(n*sizeof(int));
      |     ^
main.c:10:4: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   10 |   a=(int)malloc(n*sizeof(int));
      |    ^
main.c:39:25: error: 'k' undeclared (first use in this function)
   39 |           printf("%d",a[k]);
      |                         ^
main.c:39:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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




Compiler output:
main.c: In function 'main':
main.c:7:39: error: expected ';' before 'printf'
    7 |     for(i=0;i<n;i++) printf("%d",A[i])
      |                                       ^
      |                                       ;
    8 |     printf("\n");
      |     ~~~~~~
Language: C

#include <stdio.h>
void insertionSort(int[],int) // N個の要素を含む0-オリジンの配列A
int main(){
  int N,i;
  int A[100];
  scanf("%d",&N);
  for(i=0; i<N; i++){//for i が 1 から N-1 まで
    scanf("%d",&A[i]);
  }
  insertionSort(A, N);
  return 0;
}
void insertionSort(int A[],int N){
  int i,j,v;
  for(j=1;j<N;j++){
    if(j!=0) printf(" ");
    printf("%d",A[j]);
  }
  printf("\n");
   for(i=1;i<N;i++){
     v = A[i];
     j = i - 1;
    while(j>=0 && A[j]>v){//while j >= 0 かつ A[j] > v
      A[j+1]=A[j];
      j--;
      A[j+1]=v;
    }    
    for(j=0;j<N;j++){
      if(j!=0) printf(" ");
      printf("%d ",A[j]);
    }
    printf("\n");
   }
}



Compiler output:
main.c: In function 'insertionSort':
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main(){
      |           ^
main.c:13:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   13 | void insertionSort(int A[],int N){
      |                                  ^
main.c:36: error: expected '{' at end of input