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

#include<stdio.h>
int swap(int a*,int b*){
    int temp = a*;
    a* = *b;
    b* = temp;
}
int bubbleSort(intA[], intN)
{
int i,j,sw=0;
int flag = 1
for(i =0;flag;i++){
    flag =0;
    for(j=N-1;j=>i+1;j--){
        if(A[j]<a[j-1]){
            swap(&A[j],A[j-1]);
            sw++;
        }
    }
}
return sw;
}
int main(void)
{
    int i,A[100],N,sw;
    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){
                printf(" ");
                printf("%d"&A[i]);
            }
        }
    }
    printf("\n%d\n",sw);
    return 0;
}


Compiler output:
main.c:2:15: error: expected ';', ',' or ')' before '*' token
    2 | int swap(int a*,int b*){
      |               ^
main.c:7:16: error: unknown type name 'intA'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                ^~~~
      |                int
main.c:7:24: error: unknown type name 'intN'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                        ^~~~
      |                        int
main.c: In function 'main':
main.c:27:21: error: 'a' undeclared (first use in this function)
   27 |         scanf("%d",&a[i]);
      |                     ^
main.c:27:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:12: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   28 |         sw=bubbleSort(A,N);
      |            ^~~~~~~~~~
main.c:32:28: error: invalid operands to binary & (have 'char *' and 'int')
   32 |                 printf("%d"&A[i]);
      |                        ~~~~^~~~~
      |                        |     |
      |                        |     int
      |                        char *
Language: C

#include<stdio.h>
int swap(int a*,int b*){
    int temp = a*;
    a* = *b;
    b* = temp;
}
int bubbleSort(intA[], intN)
{
int i,j,sw=0;
int flag = 1
for(i =0;flag;i++){
    flag =0;
    for(j=N-1;j=>i+1;j--){
        if(A[j]<a[j-1]){
            swap(&A[j],A[j-1]);
            sw++;
        }
    }
}
return sw;
}
int main(void)
{
    int i,A[100],N,sw;
    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){
                printf(" ");
                printf("%d"&A[i]);
            }
        }
    
    printf("\n%d\n",sw);
    return 0;
}


Compiler output:
main.c:2:15: error: expected ';', ',' or ')' before '*' token
    2 | int swap(int a*,int b*){
      |               ^
main.c:7:16: error: unknown type name 'intA'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                ^~~~
      |                int
main.c:7:24: error: unknown type name 'intN'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                        ^~~~
      |                        int
main.c: In function 'main':
main.c:27:21: error: 'a' undeclared (first use in this function)
   27 |         scanf("%d",&a[i]);
      |                     ^
main.c:27:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:12: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   29 |         sw=bubbleSort(A,N);
      |            ^~~~~~~~~~
main.c:33:28: error: invalid operands to binary & (have 'char *' and 'int')
   33 |                 printf("%d"&A[i]);
      |                        ~~~~^~~~~
      |                        |     |
      |                        |     int
      |                        char *
Language: C

#include<stdio.h>
int swap(int a*,int b*){
    int temp = a*;
    a* = *b;
    b* = temp;
}
int bubbleSort(intA[], intN)
{
int i,j,sw=0;
int flag = 1
for(i =0;flag;i++){
    flag =0;
    for(j=N-1;j=>i+1;j--){
        if(A[j]<a[j-1]){
            swap(&A[j],A[j-1]);
            sw++;
        }
    }
}
return sw;
}
int main(void)
{
    int i,A[100],N,sw;
    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){
                printf(" ");
            }
              printf("%d"&A[i]);
        }
    
    printf("\n%d\n",sw);
    return 0;
}


Compiler output:
main.c:2:15: error: expected ';', ',' or ')' before '*' token
    2 | int swap(int a*,int b*){
      |               ^
main.c:7:16: error: unknown type name 'intA'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                ^~~~
      |                int
main.c:7:24: error: unknown type name 'intN'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                        ^~~~
      |                        int
main.c: In function 'main':
main.c:27:21: error: 'a' undeclared (first use in this function)
   27 |         scanf("%d",&a[i]);
      |                     ^
main.c:27:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:12: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   29 |         sw=bubbleSort(A,N);
      |            ^~~~~~~~~~
main.c:34:26: error: invalid operands to binary & (have 'char *' and 'int')
   34 |               printf("%d"&A[i]);
      |                      ~~~~^~~~~
      |                      |     |
      |                      |     int
      |                      char *
Language: C

#include<stdio.h>
int swap(int a*,int b*){
    int temp = a*;
    a* = *b;
    b* = temp;
}
int bubbleSort(intA[], intN)
{
int i,j,sw=0;
int flag = 1
for(i =0;flag;i++){
    flag =0;
    for(j=N-1;j=>i+1;j--){
        if(A[j]<A[j-1]){
            swap(&A[j],A[j-1]);
            sw++;
        }
    }
}
return sw;
}
int main(void)
{
    int i,A[100],N,sw;
    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){
                printf(" ");
            }
              printf("%d"&A[i]);
        }
    
    printf("\n%d\n",sw);
    return 0;
}


Compiler output:
main.c:2:15: error: expected ';', ',' or ')' before '*' token
    2 | int swap(int a*,int b*){
      |               ^
main.c:7:16: error: unknown type name 'intA'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                ^~~~
      |                int
main.c:7:24: error: unknown type name 'intN'; did you mean 'int'?
    7 | int bubbleSort(intA[], intN)
      |                        ^~~~
      |                        int
main.c: In function 'main':
main.c:29:12: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   29 |         sw=bubbleSort(A,N);
      |            ^~~~~~~~~~
main.c:34:26: error: invalid operands to binary & (have 'char *' and 'int')
   34 |               printf("%d"&A[i]);
      |                      ~~~~^~~~~
      |                      |     |
      |                      |     int
      |                      char *
Language: C


#include <stdio.h>

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

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

int main(void) {
    int i, A[100], N, sw;
    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) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);

    return 0;
}












  

slide 14/15

*  Contents 





Compiler output:
main.c:56:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
   56 | slide 14/15
      |       ^~
Language: C


#include <stdio.h>

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

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

int main(void) {
    int i, A[100], N, sw;
    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) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);
return 0:
}

    


Compiler output:
main.c: In function 'main':
main.c:39:9: error: expected ';' before ':' token
   39 | return 0:
      |         ^
      |         ;
Language: C

#include <stdio.h>

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

    *a = *b;

    *b = temp;

}



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

    unsigned short flag = 1;

    for(i=0;flag;i++) {

        flag = 0;

        for(j=N-1;j>=i+1;j--) {

            if(A[j]<A[j-1]) {

                swap(&A[j],&A[j-1]);

                flag = 1;

                sw++;

            }

        }

    }

    return sw;

}



int main(void) {

    int i, A[100], N, sw;

    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) printf(" ");

        printf("%d",A[i]);

    }

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

    return 0;

}


Compiler output:
main.c: In function 'swap':
main.c:3:28: error: stray '\343' in program
    3 | void swap(int *a, int *b) {<U+3000><U+3000>
      |                            ^~~~~~~~
main.c:3:30: error: stray '\343' in program
    3 | void swap(int *a, int *b) {<U+3000><U+3000>
      |                                    ^~~~~~~~
main.c: In function 'BubbleSort':
main.c:14:35: error: stray '\343' in program
   14 | int BubbleSort(int A[],int N) {   <U+3000>
      |                                   ^~~~~~~~
main.c:15:14: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |              ^~~~~~~~
main.c:15:16: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                      ^~~~~~~~
main.c:15:18: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                              ^~~~~~~~
main.c:15:20: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                      ^~~~~~~~
main.c:15:22: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                              ^~~~~~~~
main.c:15:24: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                                      ^~~~~~~~
Language: C

#include <stdio.h>

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

    *a = *b;

    *b = temp;

}



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

    unsigned short flag = 1;

    for(i=0;flag;i++) {

        flag = 0;

        for(j=N-1;j>=i+1;j--) {

            if(A[j]<A[j-1]) {

                swap(&A[j],&A[j-1]);

                flag = 1;

                sw++;

            }

        }

    }

    return sw;

}



int main(void) {

    int i, A[100], N, sw;

    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) printf(" ");

        printf("%d",A[i]);

    }

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

    return 0;

}


Compiler output:
main.c: In function 'swap':
main.c:3:28: error: stray '\343' in program
    3 | void swap(int *a, int *b) {<U+3000><U+3000>
      |                            ^~~~~~~~
main.c:3:30: error: stray '\343' in program
    3 | void swap(int *a, int *b) {<U+3000><U+3000>
      |                                    ^~~~~~~~
main.c: In function 'bubbleSort':
main.c:14:35: error: stray '\343' in program
   14 | int bubbleSort(int A[],int N) {   <U+3000>
      |                                   ^~~~~~~~
main.c:15:14: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |              ^~~~~~~~
main.c:15:16: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                      ^~~~~~~~
main.c:15:18: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                              ^~~~~~~~
main.c:15:20: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                      ^~~~~~~~
main.c:15:22: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                              ^~~~~~~~
main.c:15:24: error: stray '\343' in program
   15 |     int i,j; <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>
      |                                                      ^~~~~~~~
Language: C

#include<stdio.h>

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

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

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



Compiler output:
main.c:9:23: error: expected ';', ',' or ')' before 'int'
    9 | int bubbleSort(int A[]int N) {
      |                       ^~~
Language: C

#include<stdio.h>

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

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

int main(void) {
    int i,A[100], N, sw;
    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)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);
return 0;    
    }




Compiler output:
main.c: In function 'bubbleSort':
main.c:13:11: error: 'o' undeclared (first use in this function)
   13 |     for(i=o;flag;i++) {
      |           ^
main.c:13:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:17: error: expected ';' before 'for'
   14 |         flag = 0
      |                 ^
      |                 ;
   15 |         for(j=n-1;j>=i+1;j--){
      |         ~~~
Language: C

#include<stdio.h>

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

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

int main(void) {
    int i,A[100], N, sw;
    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)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);
return 0;    
    }




Compiler output:
main.c: In function 'bubbleSort':
main.c:13:11: error: 'o' undeclared (first use in this function)
   13 |     for(i=o;flag;i++) {
      |           ^
main.c:13:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:17: error: expected ';' before 'for'
   14 |         flag = 0
      |                 ^
      |                 ;
   15 |         for(j=n-1;j>=i+1;j--){
      |         ~~~
Language: C


#include <stdio.h>

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

// flagを用いたバブルソート
int bubbleSort(int A[],int N) {
    int i,j;
    int sw = 0;
    unsigned short flag = 1;
    for(i=0;flag;i++) {
        flag = 0;
        for(j=N-1;j>=i+1;j--) {
            if(A[j]<A[j-1]) {
                swap(&A[j],&A[j-1]);
                flag = 1;
                sw++;
            }
        }
    }
    return sw;
}

int main(void) {
    int i, A[100], N, sw;
    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) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);

    return 0;
}












  

slide 14/15

*  Contents 





Compiler output:
main.c:57:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
   57 | slide 14/15
      |       ^~
Language: C

import java.util.Scanner;
class Main{
    public static void main(String[]arge){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        int flag,hozon,count=0;
        flag=1;
        while(flag==1){
            flag = 0;
            for(int j=n-1; j>0; j--){
                if(A[j]<A[j-1]){
                hozon=A[j];
                A[j]=A[j-1];
                A[j-1]=hozon;
                flag=1;
                count+=1;
                }
                
            }        
            
     }
        for(int k=0; k<n; k++){
            
            if(k==n-1)System.out.print(A[k]);          
            if(k!=n-1)System.out.print(A[k]+" "); 
        }
            System.out.print();
            System.out.print(count);   
   }
}    

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 'class'
    2 | class Main{
      | ^~~~~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class Main{
      |           ^
Language: C

import java.util.Scanner;
class Main{
    public static void main(String[]arge){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []A=new int[n];
        for(int i=0; i<n; i++){
            A[i]=sc.nextInt();
        }
        int flag,hozon,count=0;
        flag=1;
        while(flag==1){
            flag = 0;
            for(int j=n-1; j>0; j--){
                if(A[j]<A[j-1]){
                hozon=A[j];
                A[j]=A[j-1];
                A[j-1]=hozon;
                flag=1;
                count+=1;
                }
                
            }        
            
     }
        for(int k=0; k<n; k++){
            
            if(k==n-1)System.out.print(A[k]);          
            if(k!=n-1)System.out.print(A[k]+" "); 
        }
            System.out.println("");
            System.out.print(count);   
   }
}    

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 'class'
    2 | class Main{
      | ^~~~~
main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | class Main{
      |           ^
Language: C

#include<stdio.h>

int main(){
  int i, j, n, v, count = 0;
  int A[100];

  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 - 1] > A[j]){
	v = A[j];
	A[j] = A[j - 1];
	A[j - 1] = v;
	count++;
      }
    }
  }

  for(i = 0; i < n; i++){
    printf("%d",A[i]);
    if(i != n - 1) printf(" ");
  }
  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>
#define N 5

main(){
  int i, n, A[N], key;
  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+1; j--){
      if(A[j] < A[j-1]) {
	key = A[j];
	A[j] = A[j-1];
	A[j-1] = key;
    }
  }
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:11:9: error: 'j' undeclared (first use in this function)
   11 |     for(j = n-1; j < i+1; j--){
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:1: error: expected declaration or statement at end of input
   18 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(void){
	int i,j,num,*arr,count,temp;
	scanf("%d",&num);
	arr = (int*)malloc(num*sizeof(int));
	for(i=0;i<num;i++) scanf("%d",&arr[i]);
	for(i=0;i<num;i++){
		for(j=i;j>0;j--){
			if(arr[j] < arr[j-1]){
				temp = arr[j];
				arr[j] = arr[j-1];
				arr[j-1] = temp;
				count++;
				}
			}
		}		
	for(i=0;i<num;i++){
		i != num-1 ? printf("%d ",arr[i]):printf("%d\n",arr[i]);
		}		
	printf("%d\n",count);
　　　　free(arr);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:1: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000>free(arr);
      | ^~~~~~~~
main.c:22:3: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000>free(arr);
      |         ^~~~~~~~
main.c:22:5: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000>free(arr);
      |                 ^~~~~~~~
main.c:22:7: error: stray '\343' in program
   22 | <U+3000><U+3000><U+3000><U+3000>free(arr);
      |                         ^~~~~~~~
Language: C

include <stdio.h>

void prtData( int data[], int n )
{
    int i;

    for( i = 0; i < n; i++ ) 
      {
	printf( "%d ", data[i] );
      }
    
    void bubbleSort( int A[], int n )
    {
      int i, j, temp;
      
      for( i = 0; i < n-1; i++ ) {
        for( j = n-1; j > i; j-- ) {
	  if( A[j-1] > A[j] ) {
                temp = A[j];
                A[j] = A[j-1];
                A[j-1] = temp;
            }
        }
	
    }
    }
    

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

include <stdio.h>

void bubbleSort(void)
{
  
  int i,j,tmp,flag,A[N];
 
 for( i = N-1 ; i >= 2 ; i = i-1 ){
   flag = 1;
   for( j = 0 ; j <= i-1 ; j = j+1 ){
     if( A[j] > A[j+1] ){
       tmp = A[j];
       A[j] = A[j+1];
       A[j+1] = tmp;
       flag = 0;
     }
   }
   if( flag == 1 ){
     break;
   }
 }

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 A[100];
  int i,j,len,sw,c=0;

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

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration or statement at end of input
   26 |   printf("%d",c);
      |   ^~~~~~
Language: C

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

void swap(int *, int *);

int main(){

  int *A, i, j, n, flag, count=0;

  scanf("%d",&n);

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

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

  flag = 1;

  while(flag){
    flag = 0;
    for(j=0; j<n-1; j++){
      for(i=n-1; i>0; i--){
	if(A[i] < A[i-1]){
	  swap(&A[i], &A[i-1]);
	  flag = 1;
	  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:
/usr/bin/ld: /tmp/ccAz0sh8.o: in function `main':
main.c:(.text+0x108): undefined reference to `swap'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

void bubbleSort(int A[], int N);

#define N 100

main(){
  int i, j, n, flag = 1, A[N]; 
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", &A[i]);
  }
  
  bubbleSort(A, n);
  return 0;
}

void bubbleSort(int A[], int N)
{
  int i, j, n, flag = 1; 

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

Compiler output:
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
    7 | main(){
      | ^~~~
main.c:5:11: error: expected ';', ',' or ')' before numeric constant
    5 | #define N 100
      |           ^~~
main.c:20:30: note: in expansion of macro 'N'
   20 | void bubbleSort(int A[], int N)
      |                              ^
Language: C

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

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

  scanf("%d",&n);
  if(n>N)
    exit(1);

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

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:28:16: error: expected ';' before '}' token
   28 |     printf(" ")
      |                ^
      |                ;
   29 |   }
      |   ~
Language: C

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

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

  scanf("%d",&n);
  if(n>N)
    exit(1);

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


  
    

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:10: error: 'k' undeclared (first use in this function)
   27 |     if ( k != n - 1)printf(" ");
      |          ^
main.c:27:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

main(){
  int i,j,a[100],n;
  int flag=1,k,d=0;

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:16: error: expected ')' before 'a'
   27 |   printf("%d\n"a[i]);
      |         ~      ^
      |                )
Language: C

#include<stdio.h>

void bubbleSort(int *,int);
#define N 100

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

void bubbleSort(int *a,int k){
  int i,j,con,temp;
  for(i=0;i<k-1;i++){
    for(j=k-1;j>=i+1;j--){
      if(a[j] < a[j-1]){
	temp = a[j];
	a[j]=a[j-1];
	a[j-1] = temp;
	con++;
      }    
    }
  }
  for(i=0;i<k-2;i++) {
    printf("%d ",a[i]);
      }
  printf("%d\n",A[k-1]);
  printf("%d\n",con);
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: passing argument 1 of 'bubbleSort' from incompatible pointer type [-Wincompatible-pointer-types]
   12 |   bubbleSort(&A,n);
      |              ^~
      |              |
      |              int (*)[100]
main.c:3:17: note: expected 'int *' but argument is of type 'int (*)[100]'
    3 | void bubbleSort(int *,int);
      |                 ^~~~~
main.c: In function 'bubbleSort':
main.c:32:17: error: 'A' undeclared (first use in this function)
   32 |   printf("%d\n",A[k-1]);
      |                 ^
main.c:32:17: 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,A[N],flag = 1;
  
  for(i = 0; flag ;i++){
    flag = 0;
    for(j = N - 1; j >= i + 1;j--){
      if(A[j] < A[j - 1]){
      swap(A[j],A[j - 1]);
      flag = 1;
      }
    }
  }
  return 0;
}

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

#include <stdio.h>

#define LOOP_INIT 0
#define SORT_CNT_INIT 0
#define TRUE 1
#define FALSE 0
#define PREV_ITEM( x ) x - 1
#define TESTCASE_ARRAY_MAX 100
#define EXIT_SUCCESS 0

int main( void )
{
	unsigned char ubW_Dtestcase[ TESTCASE_ARRAY_MAX ];
	unsigned char ubW_Dtc_cnt;
	unsigned char ubW_Dchange;
	unsigned short usW_Csort_cnt = SORT_CNT_INIT;
	unsigned char ubW_Ctc_loop_cnt;
	unsigned char ubW_Floop_flug = TRUE;

	scanf("%d", &ubW_Dtc_cnt);
	for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < ubW_Dtc_cnt; ubW_Ctc_loop_cnt++){
		scanf("%d", &ubW_Dtestcase[ ubW_Ctc_loop_cnt ] );
	}

	while( ubW_Floop_flug ){
		ubW_Floop_flug = FALSE;
		for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < ubW_Dtc_cnt; ubW_Ctc_loop_cnt++ ){
			if( ubW_Dtestcase[ ubW_Ctc_loop_cnt ] < ubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ] ){
				ubW_Dchange = ubW_Dtestcase[ ubW_Ctc_loop_cnt ];
				ubW_Dtestcase[ ubW_Ctc_loop_cnt ] = ubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ];
				ubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ] = ubW_Dchange;
				ubW_Floop_flug = TRUE;
				usW_Csort_cnt++;
			}
			else{
				/* else?????????????????????????????\ */
			}
		}
	}

	for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < PREV_ITEM( ubW_Dtc_cnt ); ubW_Ctc_loop_cnt++){
		printf("%d ", ubW_Dtestcase[ ubW_Ctc_loop_cnt ] );
	}
	printf("%d\n", ubW_Dtestcase[ ubW_Ctc_cnt ]);
	printf("%d\n", usW_Csort_cnt);
	return EXIT_SUCCESS;
}

Compiler output:
main.c: In function 'main':
main.c:44:39: error: 'ubW_Ctc_cnt' undeclared (first use in this function); did you mean 'ubW_Dtc_cnt'?
   44 |         printf("%d\n", ubW_Dtestcase[ ubW_Ctc_cnt ]);
      |                                       ^~~~~~~~~~~
      |                                       ubW_Dtc_cnt
main.c:44:39: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define BUF_SIZE 1000
#define ARR_SIZE 100

void print_array(int array[], int size)
{
  int i;
  for(i = 0; i < size; i++){
    if(i > 0) printf(" ");
    printf("%d", array[i]);
  }

  printf("\n");

  return ;
}
void bubbleSort(int array[], int size)
{
  int flag = 1;
  int tmp;
  int swap_size;
  int count = 0;

  while(flag){
    flag = 0;
    for(j = size - 1; 0 < j; j--){
      if(array[j] < array[j-1]){
        tmp = array[j];
        array[i] = array[j-1];
        array[j-1] = tmp;
        flag = 1;
        count++;
      }
    }
  }

  return count;
}

int main(void)
{
  char buf[BUF_SIZE];
  int array[ARR_SIZE];
  int size, i, swap_size;

  fgets(buf, stdio);
  sscanf(buf, "%d", &size);

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

  swap_size = bubble_sort(array, size);

  print_array(array, size);
  printf("%d", swap_size);

  return 0;
}

Compiler output:
main.c: In function 'bubbleSort':
main.c:27:9: error: 'j' undeclared (first use in this function)
   27 |     for(j = size - 1; 0 < j; j--){
      |         ^
main.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:15: error: 'i' undeclared (first use in this function)
   30 |         array[i] = array[j-1];
      |               ^
main.c:38:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   38 |   return count;
      |          ^~~~~
main.c:18:6: note: declared here
   18 | void bubbleSort(int array[], int size)
      |      ^~~~~~~~~~
main.c: In function 'main':
main.c:47:14: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   47 |   fgets(buf, stdio);
      |              ^~~~~
      |              stdin
main.c:47:3: error: too few arguments to function 'fgets'
   47 |   fgets(buf, stdio);
      |   ^~~~~
In file included from main.c:1:
/usr/include/stdio.h:654:14: note: declared here
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |              ^~~~~
main.c:54:15: error: implicit declaration of function 'bubble_sort'; did you mean 'bubbleSort'? [-Wimplicit-function-declaration]
   54 |   swap_size = bubble_sort(array, size);
      |               ^~~~~~~~~~~
      |               bubbleSort
Language: C


#include<stdio.h>

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

int main(void)
{
  int n;
  int i;
  int j;
  int array[100];
  int temp;
  int flag;

  scanf("%d", &n);

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

  for(i=n; i>0; i--)
  {
    flag = 0;
    for(j=0; j<i-1; j++)
    {   
      if(array[j] > array[j+1])
        temp = array[j];
        array[j] = array[j+1];
        array[j+1] = temp;
        flag = 1;
    }   
    if(flag==0)
      break;
  }

  trace(array, n); 
  return 0;  
}
~                                                                                                                                                                                                           
~                 

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

#include<stdio.h>

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

int main(void)
{
  int n;
  int i;
  int j;
  int array[100];
  int temp;
  int flag;

  scanf("%d", &n);

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

  for(i=n-1; i>0; i--)
  {
    flag = 0;
    for(j=0; j<i; j++)
    {   
      if(array[j] > array[j+1])
        temp = array[j];
        array[j] = array[j+1];
        array[j+1] = temp;
        flag = 1;
    }   
    if(flag==0)
      break;
  }

  trace(array, n); 
  return 0;  
}
~                                                                                                                                                                                                           
~                           

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


#include<stdio.h>

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

int main(void)
{
  int n;
  int i;
  int j;
  int array[100];
  int temp;
  int flag;

  scanf("%d", &n);

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

  for(i=n-1; i>0; i--)
  {
   flag = 0;
    for(j=0; j<i; j++)
    {   
      if(array[j] > array[j+1])
        temp = array[j];
        array[j] = array[j+1];
        array[j+1] = temp;
        flag = 1;
    }   
    if(flag==0)
      break;
  }

  trace(array, n); 
  return 0;  
}
~                                    

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

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

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

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

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

  flag = 1;
  i = 0;
  count = 0;

  while(flag) {
    flag = 0;
    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;
        count++;
      }
    i++;
  }

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

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

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

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

  flag = 1;
  i = 0;
  count = 0;

  while(flag) {
    flag = 0;
    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;
        count++;
      }
    i++;
  }

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

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

#include <stdio.h>

int main() {
  
  int N,i,j,c,flag=1,b;
  int bubbleSort[100];

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

  while(flag) {
    flog=0;
    for(j=N-1;j<1;j++) {
      if(A[j]<A[j-1]) {
	b = A[j];
	A[j] = A[j-1];
	A[j-1] = b;

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

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'flog' undeclared (first use in this function); did you mean 'flag'?
   14 |     flog=0;
      |     ^~~~
      |     flag
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:10: error: 'A' undeclared (first use in this function)
   16 |       if(A[j]<A[j-1]) {
      |          ^
Language: C

#include<stdio.h>

int main(){
  int a[100],i,j,n,m,count=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]){
	m=a[j];
	a[j]=a[j-1];
	a[j-1]=m;
	count++;
      }

    }
  }

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:5: error: implicit declaration of function 'ir' [-Wimplicit-function-declaration]
   24 |     ir(i>0) printf(" ");
      |     ^~
main.c:24:12: error: expected ';' before 'printf'
   24 |     ir(i>0) printf(" ");
      |            ^~~~~~~
      |            ;
Language: C

  int i,j,n,a[100],flag,sw,u,count=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 - 1] > a[j]) { 
	sw = a[j];        
	a[j] = a[j - 1];
	a[j - 1]= sw;
	flag = 1;
	count++;
      }

    }
    i++;
  }

  for(u=0;u<n-1;u++){

    printf("%d ",a[u]);

  }
  printf("%d",a[u]);
  printf("\n");
  printf("%d",count);
  printf("\n");
  return 0;
}

Compiler output:
main.c:3:9: error: expected declaration specifiers or '...' before string constant
    3 |   scanf("%d",&n);
      |         ^~~~
main.c:3:14: error: expected declaration specifiers or '...' before '&' token
    3 |   scanf("%d",&n);
      |              ^
main.c:5:3: error: expected identifier or '(' before 'for'
    5 |   for(i=0;i<n;i++){
      |   ^~~
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 |   for(i=0;i<n;i++){
      |            ^
main.c:5:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 |   for(i=0;i<n;i++){
      |                ^~
main.c:11:3: warning: data definition has no type or storage class
   11 |   flag = 1;
      |   ^~~~
main.c:11:3: error: type defaults to 'int' in declaration of 'flag' [-Wimplicit-int]
main.c:12:3: warning: data definition has no type or storage class
   12 |   i=0;
      |   ^
main.c:12:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:13:3: error: expected identifier or '(' before 'while'
   13 |   while(flag){
      |   ^~~~~
main.c:29:3: error: expected identifier or '(' before 'for'
   29 |   for(u=0;u<n-1;u++){
      |   ^~~
main.c:29:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   29 |   for(u=0;u<n-1;u++){
      |            ^
main.c:29:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   29 |   for(u=0;u<n-1;u++){
      |                  ^~
main.c:34:10: error: expected declaration specifiers or '...' before string constant
   34 |   printf("%d",a[u]);
      |          ^~~~
main.c:34:15: error: expected declaration specifiers or '...' before 'a'
   34 |   printf("%d",a[u]);
      |               ^
main.c:35:10: error: expected declaration specifiers or '...' before string constant
   35 |   printf("\n");
      |          ^~~~
main.c:36:10: error: expected declaration specifiers or '...' before string constant
   36 |   printf("%d",count);
      |          ^~~~
main.c:36:15: error: expected declaration specifiers or '...' before 'count'
   36 |   printf("%d",count);
      |               ^~~~~
main.c:37:10: error: expected declaration specifiers or '...' before string constant
   37 |   printf("\n");
      |          ^~~~
main.c:38:3: error: expected identifier or '(' before 'return'
   38 |   return 0;
      |   ^~~~~~
main.c:39:1: error: expected identifier or '(' before '}' token
   39 | }
      | ^
Language: C

#include <stdio.h>

int swap(int *x,int *y);

int main()
{
  int A[100],N,flag=1,j,i,temp;

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

int swap(int *x,int *y){
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}

Compiler output:
main.c: In function 'main':
main.c:29:13: error: 'n' undeclared (first use in this function)
   29 |       if(i!=n-1)printf(" ");
      |             ^
main.c:29:13: 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;
  int n, a[N], tmp;
  int flag = 1;

  scnaf("%d",&n);

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

  while(flag){
    flag = 0;

    for(i = n - 1; i > 0; i--){
      if(a[i] < a[i - 1]){
	tmp = a[i];
	a[i] = a[i - 1];
	a[i - 1] = tmp;
	flag = 1;
      }

    }

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |   scnaf("%d",&n);
      |   ^~~~~
      |   scanf
Language: C

#include <stdio.h>
#define N 100

int main(){

  int i;
  int n, a[N], tmp;
  int sum = 0, flag = 1;

  scnaf("%d",&n);

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

  while(flag){
    flag = 0;

    for(i = n - 1; i > 0; i--){
      if(a[i] < a[i - 1]){
	tmp = a[i];
	a[i] = a[i - 1];
	a[i - 1] = tmp;
	flag = 1;
	sum++;
      }

    }

  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |   scnaf("%d",&n);
      |   ^~~~~
      |   scanf
Language: C

#include<stdio.h>

int main(){
  int N,num[100];
  int i,j=0,flag,res,count=0;

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

  while(j!=N){
    flag=1;

    while(flag){
    flag=0;

  for(i=N-1;i>0;--i){
    if(num[i]<num[i-1]){
      res=num[i];
      num[i]=num[i-1];
      num[i-1]=res;
      ++count;
      flag=1;
    }
  }
    }
  ++j;
  }

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:36:22: error: expected ';' before '}' token
   36 |     else printf("\n")
      |                      ^
      |                      ;
   37 |   }
      |   ~
Language: C

#include<stdio.h>
int main(){
  
  int arr[100];
  int a=0,i,l,m,temp,count=0,x;
  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&arr[i]);
  }
  
  for(m=0;m<i;i--){
    
    for(l=m;l<i;l++){
      
      if (arr[l]>arr[l+1]){
	temp=arr[l];
	arr[l]=arr[l+1];
	arr[l+1]=temp;
	count=count++;
      }
      
      /*	for(a=0;a<x;a++){
		printf("%d",arr[a]);
	  if(a<x-1)printf(" ");
	  }
	printf("\n");
 
      */

    }
  }
  
  for(i=0;i<x;i++){
    printf("%d",arr[i]);
    if(i<x-1)printf(" ");
  }
  printf("\n");
  printf("%d\n",count);
  return 0;
}
javascript:void(0)

Compiler output:
main.c:41:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   41 | javascript:void(0)
      |           ^
Language: C

#include<stdio.h>

void bubbleSort(int,int[]);

int main(){

  int length;
  int data[100];
  int i = 0;

  scanf("%d",&length);


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

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

  }

  bubbleSort(length,data);

  return 0;

}

void bubbleSort(int length, int data[]){

  int flag = 1;
  int j,change;
  int count = 0;

  
  while(flag){

    flag = 0;

    for(j = length-1; j !=0; j--){


      if(data[j] < data[j-1]){

	change = data[j-1];

	data[j-1] = data[j];

	data[j] = change;

	flag = 1;

	count = count + 1;

      }
    }
  }


  for(j = 0; j < length; j++){

    if(j != length-1){

    printf("%d ",data[j]);

  }

    else{

      printf("%d\n",data[j]);

    }


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

}

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



#include<stdio.h>

void bubbleSort(int,int[]);

int main(){

  int length;
  int data[100];
  int i = 0;

  scanf("%d",&length);


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

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

  }

  bubbleSort(length,data);

  return 0;

}

void bubbleSort(int length, int data[]){

  int flag = 1;
  int j,change;
  int count = 0;

  
  while(flag){

    flag = 0;

    for(j = length-1; j !=0; j--){


      if(data[j] < data[j-1]){

	change = data[j-1];

	data[j-1] = data[j];

	data[j] = change;

	flag = 1;

	count = count + 1;

      }
    }
  }


  for(j = 0; j < length; j++){

    if(j != length-1){

    printf("%d ",data[j]);

  }

    else{

      printf("%d\n",data[j]);

    }


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

}

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

#include<stdio.h>

void bubbleSort(int A[],int N);

int count=0;

int main()
{

  int i;
  int A[100],N;

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

  bubbleSort(A,N);

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

  return 0;
 }

void bubbleSort(int A[],int N)
{
  int i,j,temp;

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

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