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

#include <stdio.h>

int bubbleSort(int A[], int N) {
  int i, temp, sw;
  int flag = 1;

  while (flag) {
    flag = 0;
    for (i = N-1 ; i >= 1 ; i--) {
      if (A[i] < A[i-1]) {
        temp = A[i];
        A[i] = A[i-1];
        A[i-1] = temp;

        flag = 1;
        sw++;
      }
    }
  }

  return sw;
}

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

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

  sw = bubbleSort(A, N)

  for (i = 0 ; i < N ; i++) {
    if (i > 0)
      putchar (' ');
    printf ("%d", A[i]);
  }

  putchar ('\n');

  printf ("%d\n", sw);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:3: error: 'sw' undeclared (first use in this function)
   35 |   sw = bubbleSort(A, N)
      |   ^~
main.c:35:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:24: error: expected ';' before 'for'
   35 |   sw = bubbleSort(A, N)
      |                        ^
      |                        ;
   36 | 
   37 |   for (i = 0 ; i < N ; i++) {
      |   ~~~
Language: C

#include<stdio.h>

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

int main(){
	int A[100],N,sw,i;

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:9: error: unknown type name 'bool'
    5 |         bool flag=1;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 |
Language: C

#include<stdio.h>

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

int main(){
	int A[100],N,sw,i;

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:9: error: unknown type name 'boolean'
    5 |         boolean flag=true;
      |         ^~~~~~~
main.c:5:22: error: 'true' undeclared (first use in this function)
    5 |         boolean flag=true;
      |                      ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
    5 |         boolean flag=true;
      |                      ^~~~
main.c:7:22: error: 'false' undeclared (first use in this function)
    7 |                 flag=false;
      |                      ^~~~~
main.c:7:22: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>

int bubbleSort(int A[],int N){
	int sw=0,j,temp;
	boolean flag=true;
	while(flag){
		flag=false;
		for(j=N-1;j>=1;j--){
			if(A[j]<A[j-1]){
				temp=A[j];
				A[j]=A[j-1];
				A[j-1]=temp;
				sw++;
				flag=true;
			}
		}
	}
	return sw;
}

int main(){
	int A[100],N,sw,i;

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:9: error: unknown type name 'boolean'
    5 |         boolean flag=true;
      |         ^~~~~~~
main.c:5:22: error: 'true' undeclared (first use in this function)
    5 |         boolean flag=true;
      |                      ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:5:22: note: each undeclared identifier is reported only once for each function it appears in
    5 |         boolean flag=true;
      |                      ^~~~
main.c:7:22: error: 'false' undeclared (first use in this function)
    7 |                 flag=false;
      |                      ^~~~~
main.c:7:22: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

include <stdio.h>

int main(void){
	
	int N;
	int i,minj,j;
	int A[100],count=0;

	scanf("%d",&N);

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

	for(i=0;i<N;i++){
	minj = i;
	for(j=i+1;j<N;j++){
	if(A[j] < A[minj]){
	minj = j;
	}
}
      int tmp =A[i];
      A[i] = A[minj];
      A[minj] = tmp;
      if(i != minj){
      count++;
	}
}

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

    return 0;

}

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

#include <stdio.h>
int main(){
????int n,i,j,temp,count,num[100];
????
????scanf("%d",&n);
????for(i = 0;i < n;i++) scanf("%d",&num[i]);
  count=0;??

????for(i = 0;i < n-1;i++){
????????for(j = n-1; j > 0; j--){
????????????if(num[j]<num[j-1]){
????????   temp = num[j];
????????   num[j] = num[j-1];
????????   num[j-1] = temp;
????????   count++;
????????????}
????????}
????}
??
????for(i = 0;i < n-1;i++){
????????printf("%d ",num[i]);
????}
????printf("%d",num[n-1]);
????printf("\n%d\n",count);
??
????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????int n,i,j,temp,count,num[100];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????
      | ^
main.c:5:17: error: 'n' undeclared (first use in this function)
    5 | ????scanf("%d",&n);
      |                 ^
main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:1: error: expected expression before '?' token
    6 | ????for(i = 0;i < n;i++) scanf("%d",&num[i]);
      | ^
main.c:7:3: error: 'count' undeclared (first use in this function)
    7 |   count=0;??
      |   ^~~~~
main.c:7:11: error: expected expression before '?' token
    7 |   count=0;??
      |           ^
main.c:24:1: error: expected expression before '?' token
   24 | ????printf("\n%d\n",count);
      | ^
main.c:25:1: error: expected expression before '?' token
   25 | ??
      | ^
Language: C

#include <stdio.h>
int main(){
 int n,i,j,temp,count,num[100];

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

 for(i = 0;i < n-1;i++){
  for(j = n-1; j > 0; j--){
   if(num[j]<num[j-1]){
 ??????   temp = num[j];
 ??????   num[j] = num[j-1];
 ??????   num[j-1] = temp;
 ??????   count++;
 ??????????}
 ??????}
 ??}
 
 ??for(i = 0;i < n-1;i++){
 ??????printf("%d ",num[i]);
 ??}
 ??printf("%d",num[n-1]);
 ??printf("\n%d\n",count);
 
 ??return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:10: error: expected expression before '?' token
    7 |  count=0;??
      |          ^
main.c:24:2: error: expected expression before '?' token
   24 |  ??printf("\n%d\n",count);
      |  ^
main.c:26:2: error: expected expression before '?' token
   26 |  ??return 0;
      |  ^
Language: C

#include <stdio.h>
int main(){
 int n,i,j,temp,count,num[100];
 
 scanf("%d",&n);
 for(i = 0;i < n;i++) scanf("%d",&num[i]);
 count=0;?

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

Compiler output:
main.c: In function 'main':
main.c:7:10: error: expected expression before '?' token
    7 |  count=0;?
      |          ^
Language: C

#include<stdio.h>
using namespace std;
int main(){
 int a[10],n,t;
 int sum=0;
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d ",&a[i]);
  }
  for(int i=n-1;i>=0;i--){
    for(int j=0;j<i+1;j++){
        if(a[j]>a[j+1]){
            t=a[j+1];
            a[j+1]=a[j];
            a[j]=t;
            sum++;
        }
    }
  }
for(int i=0;i<n-1;i++){
    printf("%d ",a[i]);
}
 printf("%d\n",a[n-1]);

printf("%d",sum);
 return 0;
}

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

#include<cstdio>
#include<iostream>
int a[100];
using namespace std;
int main()
{
    int n,sum=0;
    scanf("%d",&n);
    for (int i=0;i<n;i++)
        scanf("%d",&a[i]);
        bool flag=1;
        while(flag)
        {
            flag=0;
            for(int j=n-1;j>=1;j--)
            {
                if(a[j]<a[j-1])
                {
                    swap(a[j],a[j-1]);
                    flag=1;
                    sum++;
                }
            }
        }
    for (int i=0;i<n;i++)
      printf("%d ",a[i]);
      printf("\n");
      printf("%d\n",sum);
    return 0;
}

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

#include<stdio.h>

static const int N = 1000;

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

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

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

  trace(A, n);

  /*
  * Insert sort
  */
  // for ( i = 2; i < n+1 ; i++) {
  //   int key = A[i];
  //   int j = i-1;
  //   while (j >= 1 && A[j] > key) {
  //     A[j+1] = A[j];
  //     j--;
  //   }
  //   A[j+1] = key;
  //   trace(A, n);
  //    /* code */
  // }

  /*
  * Bubble sort
  */
  for (i =1; i< n+1; i++){
    for ( j = n; j >= i+1; j--) {
      if (A[j] < A[j-1])
        int tmp = A[j];
        A[j] = A[j-1];
        A[j-1] = tmp;
      /* code */
    }
    trace(A, n)
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:44:9: error: expected expression before 'int'
   44 |         int tmp = A[j];
      |         ^~~
main.c:46:18: error: 'tmp' undeclared (first use in this function)
   46 |         A[j-1] = tmp;
      |                  ^~~
main.c:46:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:49:16: error: expected ';' before '}' token
   49 |     trace(A, n)
      |                ^
      |                ;
   50 |   }
      |   ~
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]);


  /*
  * Insert sort
  */
  // trace(A, n);
  // for ( i = 2; i < n+1 ; i++) {
  //   int key = A[i];
  //   int j = i-1;
  //   while (j >= 1 && A[j] > key) {
  //     A[j+1] = A[j];
  //     j--;
  //   }
  //   A[j+1] = key;
  //   trace(A, n);
  //    /* code */
  // }

  /*
  * Bubble sort
  */
  int count = 0;
  for (i =1; i< n+1; i++){
    for ( j = n; j >= i+1; j--) {
      if (A[j] < A[j-1]){
        count += 1;
        int tmp = A[j];
        A[j] = A[j-1];
        A[j-1] = tmp;
      }
      /* code */
    }
  }
  trace(A,n)
  printf("%d", count);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:53:13: error: expected ';' before 'printf'
   53 |   trace(A,n)
      |             ^
      |             ;
   54 |   printf("%d", count);
      |   ~~~~~~
Language: C

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

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

#include<stdio.h>

int count=0,A[100]={};

void bubbleSort(N){
	int j,t.flag=1;
	while(flag){
		flag=0;
		for(j=N-1;j>0;j--){
			if(A[j]<A[j-1]]){
				t=A[j];
				A[j]=A[j-1];
				A[j-1]=t;
				count++;
				flag = 1;
			}
		}
	}
					
}
int main(){
	int i,N,A[100];

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:6: error: type of 'N' defaults to 'int' [-Wimplicit-int]
    5 | void bubbleSort(N){
      |      ^~~~~~~~~~
main.c:6:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 |         int j,t.flag=1;
      |                ^
main.c:7:15: error: 'flag' undeclared (first use in this function)
    7 |         while(flag){
      |               ^~~~
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:39: error: expected ')' before ']' token
   10 |                         if(A[j]<A[j-1]]){
      |                           ~           ^
      |                                       )
main.c:10:39: error: expected statement before ']' token
main.c:10:40: error: expected statement before ')' token
   10 |                         if(A[j]<A[j-1]]){
      |                                        ^
main.c:11:33: error: 't' undeclared (first use in this function)
   11 |                                 t=A[j];
      |                                 ^
main.c: In function 'main':
main.c:27:26: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   27 |         for(i=0;i<N;i++) pritf("%d ",A[i]);
      |                          ^~~~~
      |                          printf
Language: C

#include<stdio.h>

int main(){
	int i,j,t,flag=1,count=0,N,A[100]={};

	scanf("%d",&N);
	for(i=0;i<N;i++) scanf("%d",&A[i]);
	
	while(flag){
		flag=0;
		for(j=N-1;j>0;j--){
			if(A[j]<A[j-1]]){
				t=A[j];
				A[j]=A[j-1];
				A[j-1]=t;
				count++;
				flag = 1;
			}
		}
	}

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

Compiler output:
main.c: In function 'main':
main.c:12:39: error: expected ')' before ']' token
   12 |                         if(A[j]<A[j-1]]){
      |                           ~           ^
      |                                       )
main.c:12:39: error: expected statement before ']' token
main.c:12:40: error: expected statement before ')' token
   12 |                         if(A[j]<A[j-1]]){
      |                                        ^
main.c:22:26: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   22 |         for(i=0;i<N;i++) pritf("%d ",A[i]);
      |                          ^~~~~
      |                          printf
Language: C

#include<stdio.h>

int main(){
	int i,j,t,flag=1,count=0,N,A[100]={};

	scanf("%d",&N);
	for(i=0;i<N;i++) scanf("%d",&A[i]);
	
	while(flag){
		flag=0;
		for(j=N-1;j>0;j--){
			if(A[j]<A[j-1]){
				t=A[j];
				A[j]=A[j-1];
				A[j-1]=t;
				count++;
				flag = 1;
			}
		}
	}

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

Compiler output:
main.c: In function 'main':
main.c:22:26: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   22 |         for(i=0;i<N;i++) pritf("%d ",A[i]);
      |                          ^~~~~
      |                          printf
Language: C

#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,c=0;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<n-1;i++)
    {
        for(int j=0;j<n-1-i;j++)
        {
            if(a[j+1]<a[j])
            {
                swap(a[j+1],a[j]);c++;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        cout<<a[i]<<" ";
    }
    cout<<endl<<c;
}

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

#include<stdio.h>

int main() {
  int i,j,sum;
  
  scanf("%d",&sum);
  int sei[sum]temp=0;
  int number=sizeof(sei)/sizeof(int);

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

  for(i=0;i<number;i++){
    for(j=number-1;j>i;j--){
      if(sei[j]<sei[j-1]){
      temp=sei[j-1];
      test[j-1]=test[j];
      test[j]=temp;
      }
    }
  }

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

Compiler output:
main.c: In function 'main':
main.c:7:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'temp'
    7 |   int sei[sum]temp=0;
      |               ^~~~
main.c:7:15: error: 'temp' undeclared (first use in this function)
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:21: error: 'sei' undeclared (first use in this function)
    8 |   int number=sizeof(sei)/sizeof(int);
      |                     ^~~
main.c:18:7: error: 'test' undeclared (first use in this function)
   18 |       test[j-1]=test[j];
      |       ^~~~
Language: C

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main()
{
	int i, j, temp,sum,sei[100],num=0;
	scanf_s("%d",&sum);

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

	for (i = 0; i < sum; i++)
	{
		for (j = sum - 1; j > i; j--)
		{
			if (sei[j] < sei[j - 1])
			{
				temp = sei[j - 1];
				sei[j - 1] = sei[j];
				sei[j] = temp;
				num++;
			}
		}
	}

	for (i = 0;; i++)
	{
		printf("%d",sei[i]);
		if (i < sum)break;
		printf(" ");
	}

	printf("\n%d\n",num);
    return 0;
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main()
{
	int i, j, temp,sum,sei[100],num=0;
	scanf_s("%d",&sum);

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

	for (i = 0; i < sum; i++)
	{
		for (j = sum - 1; j > i; j--)
		{
			if (sei[j] < sei[j - 1])
			{
				temp = sei[j - 1];
				sei[j - 1] = sei[j];
				sei[j] = temp;
				num++;
			}
		}
	}

	for (i = 0;; i++)
	{
		printf("%d",sei[i]);
		if (i >= sum)break;
		printf(" ");
	}

	printf("\n%d\n",num);
    return 0;
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main()
{
	int i, j, temp,sum,sei[100],num=0;
	scanf_s("%d",&sum);

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

	for (i = 0; i < sum; i++)
	{
		for (j = sum - 1; j > i; j--)
		{
			if (sei[j] < sei[j - 1])
			{
				temp = sei[j - 1];
				sei[j - 1] = sei[j];
				sei[j] = temp;
				num++;
			}
		}
	}

	for (i = 0;; i++)
	{
		printf("%d",sei[i]);
		if (i > sum)break;
		printf(" ");
	}

	printf("\n%d\n",num);
    return 0;
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main()
{
	int i, j, temp,sum,sei[100],num=0;
	scanf_s("%d",&sum);

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

	for (i = 0; i < sum; i++)
	{
		for (j = sum - 1; j > i; j--)
		{
			if (sei[j] < sei[j - 1])
			{
				temp = sei[j - 1];
				sei[j - 1] = sei[j];
				sei[j] = temp;
				num++;
			}
		}
	}

	for (i = 0;; i++)
	{
		printf("%d",sei[i]);
		if (i >= sum-1)break;
		printf(" ");
	}

	printf("\n%d\n",num);
    return 0;
}

Compiler output:
main.c:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

#define N 100

int main(){

int i;
int j;
int n;
int tmp;
int count=0;
int data[N];

scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",&data[i]);
 }
for(i=0;i<n-1;i++){
 for(j=1;j<n;j++){
   tmp = data[j];
   data[j] = data[j-1];
   data[j-1] = tmp;
   count++;
  }
 }
}

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

Compiler output:
main.c:29:1: error: expected identifier or '(' before 'for'
   29 | for(i=0;i<n;i++){
      | ^~~
main.c:29:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   29 | for(i=0;i<n;i++){
      |          ^
main.c:29:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   29 | for(i=0;i<n;i++){
      |              ^~
main.c:32:8: error: expected declaration specifiers or '...' before string constant
   32 | printf("\n");
      |        ^~~~
main.c:33:8: error: expected declaration specifiers or '...' before string constant
   33 | printf("%d\n",count);
      |        ^~~~~~
main.c:33:15: error: unknown type name 'count'
   33 | printf("%d\n",count);
      |               ^~~~~
main.c:34:1: error: expected identifier or '(' before 'return'
   34 | return 0;
      | ^~~~~~
main.c:35:1: error: expected identifier or '(' before '}' token
   35 | }
      | ^
Language: C

#include <stdio.h>
void bubbleSort(int *A,int N);
int cnt=0;
int main(){

  int n,a[100],i;

  scanf("%d",&n);

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

  bubbleSort(a,n);

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

  }
  printf("\n");
  printf("%d\n",cnt);
}


void bubbleSort(int *a,int n){
  int j,flag=1,sub;

  while(flag){
    flag=0;5
    for(j=n-1;j>=1;j--){
      if(a[j]<a[j-1]){
	sub=a[j];
	a[j]=a[j-1];
	a[j-1]=sub;
	cnt++;
	flag=1;
      }

    }
  }
}
  
      

Compiler output:
main.c: In function 'bubbleSort':
main.c:34:13: error: expected ';' before 'for'
   34 |     flag=0;5
      |             ^
      |             ;
   35 |     for(j=n-1;j>=1;j--){
      |     ~~~
Language: C

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

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

#include<stdio.h>

main(){
int N;
int sort[];
int i,j,temp;
int flag=0;

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

for(i=0;i<N-1;i++){
for(j=N-1;j>i;j--){
if(sort[j-1]>x[j]){
temp=sort[j];
sort[j]=sort[j-1];
sort[j-1]=temp;
}
flag++;
}
for(i=0;i<n;i++)printf("%d ",sort[i]);
printf("\n");
printf("%d\n",flag);
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:5: error: array size missing in 'sort'
    5 | int sort[];
      |     ^~~~
main.c:10:13: error: 'I' undeclared (first use in this function)
   10 | for(i=0;i<N;I++)scanf("%d",&sort[i]);
      |             ^
main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:14: error: 'x' undeclared (first use in this function)
   14 | if(sort[j-1]>x[j]){
      |              ^
main.c:21:11: error: 'n' undeclared (first use in this function)
   21 | for(i=0;i<n;i++)printf("%d ",sort[i]);
      |           ^
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C

#include<stdio.h>
#define n

main(){
int N;
int sort[n];
int i,j,temp;
int flag=0;

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

for(i=0;i<N-1;i++){
for(j=N-1;j>i;j--){
if(sort[j-1]>x[j]){
temp=sort[j];
sort[j]=sort[j-1];
sort[j-1]=temp;
}
flag++;
}
for(i=0;i<n;i++)printf("%d ",sort[i]);
printf("\n");
printf("%d\n",flag);
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:6:5: error: array size missing in 'sort'
    6 | int sort[n];
      |     ^~~~
main.c:11:13: error: 'I' undeclared (first use in this function)
   11 | for(i=0;i<N;I++)scanf("%d",&sort[i]);
      |             ^
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:14: error: 'x' undeclared (first use in this function)
   15 | if(sort[j-1]>x[j]){
      |              ^
main.c:22:12: error: expected expression before ';' token
   22 | for(i=0;i<n;i++)printf("%d ",sort[i]);
      |            ^
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C


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

  int i,j,flag,N,S,c=0;
  scanf("%d",&N);
  int A[N];
  for (i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(j=0;j<N;j++){
    for(i=N-1;i>0;i--){
      if(A[i]<A[i-1]){
	S=A[i];
	A[i]=A[i-1];
	A[i-1]=S;

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

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

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

#include <stdio.h>

int main()
{
  int j, A[100], N, v, flag, count;

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

  flag=1;
  count=0;

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

Compiler output:
main.c: In function 'main':
main.c:28:8: error: 'i' undeclared (first use in this function)
   28 |     if(i>0) printf(" ");
      |        ^
main.c:28:8: 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 a,number[N],i,j,cnt=0,tmp;

  scanf("%d",&a);

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

Compiler output:
main.c: In function 'main':
main.c:23:15: error: expected declaration or statement at end of input
   23 |               number[j] = tmp;
      |               ^~~~~~
main.c:23:15: error: expected declaration or statement at end of input
main.c:23:15: error: expected declaration or statement at end of input
main.c:23:15: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int main()
{
  int N;
  int A[100];
  int i, j, tmp, counter = 0;

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

Compiler output:
main.c: In function 'main':
main.c:30:15: error: 'n' undeclared (first use in this function)
   30 |       if(i != n-1) printf(" ");
      |               ^
main.c:30:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define K 100;

int main()
{
  int A[K], N, sw, i;

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

  sw = bubbleSort(A,N);
  
  printf("%d\n",sw);
 
  return 0;
}

int bubbleSort(int A[],int N)
{
  int sw = 0, i, j, temp;

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

Compiler output:
main.c: In function 'main':
main.c:3:14: error: expected ']' before ';' token
    3 | #define K 100;
      |              ^
main.c:7:9: note: in expansion of macro 'K'
    7 |   int A[K], N, sw, i;
      |         ^
main.c:9:15: error: 'N' undeclared (first use in this function)
    9 |   scanf("%d",&N);
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:7: error: 'i' undeclared (first use in this function)
   11 |   for(i = 1 ; i < N + 1 ; i++)
      |       ^
main.c:13:19: error: 'A' undeclared (first use in this function)
   13 |       scanf("%d",&A[i]);
      |                   ^
main.c:16:3: error: 'sw' undeclared (first use in this function)
   16 |   sw = bubbleSort(A,N);
      |   ^~
main.c:16:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   16 |   sw = bubbleSort(A,N);
      |        ^~~~~~~~~~
Language: C

#include<stdio.h>

int main()  {

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

Compiler output:
main.c: In function 'main':
main.c:20:7: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   20 |       swap(A[j],A[j-1]);
      |       ^~~~
Language: C

int main(){
  int n,A[N];
  int i,j,flag=0,change=0;

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

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

void swap(int *a,int *b){
  int tmp;
  tmp=*a;
  *a=*b;
  *b=tmp;
}

Compiler output:
main.c: In function 'main':
main.c:2:11: error: 'N' undeclared (first use in this function)
    2 |   int n,A[N];
      |           ^
main.c:2:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:16:9: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   16 |         swap(&A[j],&A[j-1]);
      |         ^~~~
main.c:23:22: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   23 |   for(i=0;i<n-1;i++) printf("%d ",A[i]);
      |                      ^~~~~~
main.c:23:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:22: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:23:22: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   24 |   if(i==n-1)printf("%d\n",A[i]);
      |             ^~~~~~
main.c:24:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   25 |   printf("%d\n",change);
      |   ^~~~~~
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:29:6: warning: conflicting types for 'swap'; have 'void(int *, int *)'
   29 | void swap(int *a,int *b){
      |      ^~~~
main.c:16:9: note: previous implicit declaration of 'swap' with type 'void(int *, int *)'
   16 |         swap(&A[j],&A[j-1]);
      |         ^~~~
Language: C

#include <stdio.h>
int bubblesort(int A[],int N){
  int sw,j,i,count;
for(i=0;i<N;i++){
  for(j=N-1;j>=i+1;j--){
    if(A[j]<A[j-1]){
      sw=A[j];
      A[j]=A[j-1];
      A[j-1]=sw;

      count++;
    }
  }
}
return count;
}

int main(){
  int N,i,sw;

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

    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:23:17: error: 'A' undeclared (first use in this function)
   23 |     scanf("%d",&A[i]);
      |                 ^
main.c:23:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:19: error: expected ')' before 'sw'
   31 |     printf("%d?\n"sw);
      |           ~       ^~
      |                   )
Language: C

#include <stdio.h>
int bubblesort(int A[],int N){
  int sw,j,i,count;
for(i=0;i<N;i++){
  for(j=N-1;j>=i+1;j--){
    if(A[j]<A[j-1]){
      sw=A[j];
      A[j]=A[j-1];
      A[j-1]=sw;

      count++;
    }
  }
}
return count;
}

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

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

    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:19:14: error: array size missing in 'A'
   19 |   int N,i,sw,A[];
      |              ^
main.c:31:19: error: expected ')' before 'sw'
   31 |     printf("%d?\n"sw);
      |           ~       ^~
      |                   )
Language: C

for(i=0;i<=3;i++)
    {
        for(j=3;j>i;j--)
        {
            if(hai[j]<hai[j-1])
            {
                temp=hai[j];
                hai[j]=hai[j-1];
                hai[j-1]=temp;
            }
        }
        printf("%d ",hai[i]);
    }

    return 0;
}

Compiler output:
main.c:1:1: error: expected identifier or '(' before 'for'
    1 | for(i=0;i<=3;i++)
      | ^~~
main.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    1 | for(i=0;i<=3;i++)
      |          ^~
main.c:1:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 | for(i=0;i<=3;i++)
      |               ^~
main.c:15:5: error: expected identifier or '(' before 'return'
   15 |     return 0;
      |     ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:5:15: error: 'n' undeclared (first use in this function)
    5 |   scanf("%d",&n);
      |               ^
main.c:5:15: 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,n,num[N],tmp,count=0;
  scanf("%d",&n);

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:19:11: error: expected expression before '<' token
   19 |   for(j=0;<n;j++){
      |           ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:3:7: error: array size missing in 'res'
    3 |   int res[],n,flag,j,count,i;
      |       ^~~
main.c:19:3: error: expected declaration or statement at end of input
   19 |   }
      |   ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:19:11: error: expected expression before '<' token
   19 |   for(j=0;<n;j++){
      |           ^
Language: C

#include<stdio.h>
int main(){
  int A[100],N;
  int i,j,k,flag,temp,num=0;

  scanf("%d",&N);

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


  while(flag){
    flag=0;
    for(j=N-1;j>=1;j--){
      if(A[j]<A[j-1]){
	temp=A[j];
	A[j]=A[j-1];
	A[j-1]=temp;
	num++;
	flag=1;
      }
    }
  }

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

    return 0;
    
}

Compiler output:
main.c: In function 'main':
main.c:26:14: error: expected ')' before 'A'
   26 |   printf("%d"A[0]);
      |         ~    ^
      |              )
Language: C

#include<stdio.h>

int bubbleSort(int* ,int);

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

  cnt = bubbleSort(value,n);

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

  return 0;

}
int bubbleSort(int *A,int n){
  int i,j,tmp,cnt = 0;

  for(i = 0; i < n - 1;i++){
      for(j = n - 1; j > i;j--){
	if(A[j] < A[j-1]) {
	  tmp = A[j];
	  A[j] = A[j-1];
	  A[j-1] = tmp;
	  cnt++;
	}
      }
    }
  return cnt;
	}

Compiler output:
main.c: In function 'main':
main.c:8:7: error: array size missing in 'value'
    8 |   int value[];
      |       ^~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:21:8: error: 'j1' undeclared (first use in this function); did you mean 'j'?
   21 |     if(j1=n-1){
      |        ^~
      |        j
main.c:21:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
  int N,i,j,count,sw;

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

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

Compiler output:
main.c: In function 'main':
main.c:24:11: error: 'n' undeclared (first use in this function)
   24 |     if(i!=n-1) printf(" ");
      |           ^
main.c:24:11: 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 n, i, j, temp, count=0;
  int A[N+1];
  scanf("%d",&n);
  for(i=0;i<n;i++) {
    scanf("%d",&A[i]);
  }
  
  for(i = 0; i<n-1; i++) {
    for(j=n-1;j>0;j--) {
      if(A[j]< A[j -1]) {
	temp = A[j-1];
	A[j-1] = A[j];
	A[j] = temp;
	count++;
      }
    }
  }
  for(i=0;i<n;i++) printf("%d ",A[i]);
  printf("\n");
  printf("%d\n", count);
  return 0;

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

#include <stdio.h>
void output(int *,int );
int main(){
?? int i,j,n,han=1,hozon,cnt=0;
?? scanf("%d",&n);
?? int hai[n];
?? for(i=0;i<n;i++)
?? ?? scanf("%d",&hai[i]);
?? while(han){
?? ?? han=0;
?? ?? for(j=n-1;j>0;j--){
?? ?? ?? if(hai[j]<hai[j-1]){
?? ?? ?? ?? hozon=hai[j-1];
?? ?? ?? ?? hai[j-1]=hai[j];
?? ?? ?? ?? hai[j]=hozon;
?? ?? ?? ?? han=1;
?? ?? ?? ?? cnt+=1;
?? ?? ?? }
?? ?? }
?? }
?? output(hai,n);
?? printf("%d\n",cnt);
?? return 0;
}
void output(int *hai,int n){
?? int i,j;
???

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

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
    4 | ?? int i,j,n,han=1,hozon,cnt=0;
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ?? scanf("%d",&n);
      | ^
main.c:5:16: error: 'n' undeclared (first use in this function)
    5 | ?? scanf("%d",&n);
      |                ^
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:1: error: expected expression before '?' token
    6 | ?? int hai[n];
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ?? for(i=0;i<n;i++)
      | ^
main.c:9:1: error: expected expression before '?' token
    9 | ?? while(han){
      | ^
main.c:22:1: error: expected expression before '?' token
   22 | ?? printf("%d\n",cnt);
      | ^
main.c:22:18: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   22 | ?? printf("%d\n",cnt);
      |                  ^~~
      |                  int
main.c:23:1: error: expected expression before '?' token
   23 | ?? return 0;
      | ^
main.c: In function 'output':
main.c:26:1: error: expected expression before '?' token
   26 | ?? int i,j;
      | ^
main.c:27:1: error: expected expression before '?' token
   27 | ???
      | ^
Language: C

#include <stdio.h>

int main()
{

 int N;
 int tmp;
 int i,j;
 int A[100];
 int count=0;

 scanf("%d", &N); 

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


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


  printf("\n"):
  printf("%d", count);
  

  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:39:15: error: expected ';' before ':' token
   39 |   printf("\n"):
      |               ^
      |               ;
Language: C

void bubbleSort(int numbers[], int array_size)
{
  int i, j, temp;

  for (i = 0; i < (array_size - 1); i++) {
    for (j = (array_size - 1); j > i; j--) {
      if (numbers[j-1] > numbers[j]) {
        temp = numbers[j-1];
        numbers[j-1] = numbers[j];
        numbers[j] = temp;
      }
    }
  }
}

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

Compiler output:
main.c: In function 'main':
main.c:27:9: error: 'i' undeclared (first use in this function)
   27 |         i;nt N, i, j;
      |         ^
main.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:11: error: unknown type name 'nt'; did you mean 'int'?
   27 |         i;nt N, i, j;
      |           ^~
      |           int
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
int main(){
    int i,j,k,l,a[100],tmp,count=0;
    char input[4001],*p;
     
    fgets(input,sizeof input,stdin);
    sscanf(input,"%d",&i);
     
    fgets(input,sizeof input,stdin);
    p=strtok(input," ");
    a[0]=atoi(p);
     
    for(j=1;j<n;j++){
        p=strtok(NULL," ");
        a[j]=atoi(p);
    }
     
    l=i-1;
    for(j=0;j<n-1;j++){
        for(k=0;k<l;k++){
            if(a[k]>a[k+1]){
                tmp=a[k];
                a[k]=a[k+1];
                a[k+1]=tmp;
                count++;
            }
        }
        l--;
    }
    for(j=0;j<n;j++){
        printf("%d",a[j]);
        if(j!=i-1){
            printf(" ");
        }
    }
    printf("\n%d\n",count);
     
     
     
     
    return 0;
}

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