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

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

void bubblesort(int a,int N){
  int i,j,v,s;
  s=0;
  for(i=1;i<N;i++){
    v=a[i];
    j=i-1;
    for(j=N-1;j>=i;j--){ 
      if(a[j]<v){
      a[j-1]=a[j];
      j--;
      s++;
      }
    a[j+1]=v;
    }
  }
  trace(a,N);
}
  
int main(void)
{
  int i,j,N,a[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  bubblesort(a,N);
  printf("%d\n",s);
  return 0;
}
  

Compiler output:
main.c: In function 'bubblesort':
main.c:17:8: error: subscripted value is neither array nor pointer nor vector
   17 |     v=a[i];
      |        ^
main.c:20:11: error: subscripted value is neither array nor pointer nor vector
   20 |       if(a[j]<v){
      |           ^
main.c:21:8: error: subscripted value is neither array nor pointer nor vector
   21 |       a[j-1]=a[j];
      |        ^
main.c:21:15: error: subscripted value is neither array nor pointer nor vector
   21 |       a[j-1]=a[j];
      |               ^
main.c:25:6: error: subscripted value is neither array nor pointer nor vector
   25 |     a[j+1]=v;
      |      ^
main.c:28:9: error: passing argument 1 of 'trace' makes pointer from integer without a cast [-Wint-conversion]
   28 |   trace(a,N);
      |         ^
      |         |
      |         int
main.c:2:16: note: expected 'int *' but argument is of type 'int'
    2 | void trace(int a[],int N){
      |            ~~~~^~~
main.c: In function 'main':
main.c:38:14: error: passing argument 1 of 'bubblesort' makes integer from pointer without a cast [-Wint-conversion]
   38 |   bubblesort(a,N);
      |              ^
      |              |
      |              int *
main.c:13:21: note: expected 'int' but argument is of type 'int *'
   13 | void bubblesort(int a,int N){
      |                 ~~~~^
main.c:39:17: error: 's' undeclared (first use in this function)
   39 |   printf("%d\n",s);
      |                 ^
main.c:39:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

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

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

Compiler output:
main.c:3:16: error: unknown type name 'intA'; did you mean 'int'?
    3 | int bubbleSort(intA[], int N){
      |                ^~~~
      |                int
main.c: In function 'main':
main.c:30:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   30 |   sw = bubbleSort(A, N);
      |        ^~~~~~~~~~
Language: C

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

void bubblesort(int a[],int N){
  int i,j,v,s;
  s=0;
  for(i=1;i<N;i++){
    v=a[i];
    j=i-1;
    for(j=N-1;j>=i;j--){ 
      if(a[j]<v){
      a[j-1]=a[j];
      j--;
      s++;
      }
    a[j+1]=v;
    }
  }
  trace(a,N);
}
  
int main(void)
{
  int i,j,N,a[100];
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&a[i]);
  }
  bubblesort(a,N);
  printf("%d\n",s);
  return 0;
}
  

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

#include <stdio.h>

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

  return 0; 
}

int bubbleSort(int A[], int n)  {
  int i, j, sw = 0, 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;
  }
}

    

Compiler output:
main.c: In function 'main':
main.c:11:8: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   11 |   sw = bubbleSort(A, n);
      |        ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:26:3: error: unknown type name 'bool'
   26 |   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>
  
void bubbleSort( int A[], int N )
{
   int i, j, v;
   int wa = 0;

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

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

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:29:3: error: 's' undeclared (first use in this function)
   29 |   s=bubblesort(a,N);
      |   ^
main.c:29:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

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

Compiler output:
main.c: In function 'main':
main.c:29:3: error: 's' undeclared (first use in this function)
   29 |   s=bubblesort(a,N);
      |   ^
main.c:29:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:33:10: error: expected declaration specifiers or '...' before string constant
   33 |   printf("%d\n",s);
      |          ^~~~~~
main.c:33:17: error: unknown type name 's'
   33 |   printf("%d\n",s);
      |                 ^
main.c:34:3: 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>
 
int main() {
   int A[100], i, 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");
   printf("%d\n", sw);
 
   return 0; 
}

 
int bubbleSort(int A[], int N)  {

   int i, j, temp, sw = 0, flag = 1;
 
   for ( i = 0; flag == 1; 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;
}
 
    

Compiler output:
main.c: In function 'main':
main.c:6:17: error: 'n' undeclared (first use in this function)
    6 |    scanf("%d", &n);
      |                 ^
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   11 |    sw = bubbleSort(A, N);
      |         ^~~~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:17: error: 'n' undeclared (first use in this function)
    6 |    scanf("%d", &n);
      |                 ^
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:9: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   11 |    sw = bubbleSort(A, N);
      |         ^~~~~~~~~~
Language: C

#include <stdio.h>

int bubblesort(int a[],N){
    int i,j,s,z,flag;
    s=0;
    z=0;
    flag=1;
    for(i=0;flag;i++){
      flag=0;
      for(j=N-1;j>=i+1;j--){
        if(a[j]<a[j-1]){
          z=a[j-1];
          a[j-1]=a[j];
          a[j]=z;
          flag=1;
          s++;
        }
      }
    }
  return s;
}

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

  s=bubblesort(a,N);
  printf("%d\n",s);
  return 0;
}

    

Compiler output:
main.c:3:24: error: unknown type name 'N'
    3 | int bubblesort(int a[],N){
      |                        ^
main.c: In function 'main':
main.c:38:3: error: 's' undeclared (first use in this function)
   38 |   s=bubblesort(a,N);
      |   ^
main.c:38:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:5: error: implicit declaration of function 'bubblesort' [-Wimplicit-function-declaration]
   38 |   s=bubblesort(a,N);
      |     ^~~~~~~~~~
Language: C

#include <stdio.h>

int bubblesort(int a[],N){
    int i,j,s,z,flag;
    s=0;
    z=0;
    flag=1;
    for(i=0;flag;i++){
      flag=0;
      for(j=N-1;j>=i+1;j--){
        if(a[j]<a[j-1]){
          z=a[j-1];
          a[j-1]=a[j];
          a[j]=z;
          flag=1;
          s++;
        }
      }
    }
  return s;
}

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

  s=bubblesort(a,N);
  printf("%d\n",s);
  return 0;
}

    

Compiler output:
main.c:3:24: error: unknown type name 'N'
    3 | int bubblesort(int a[],N){
      |                        ^
main.c: In function 'main':
main.c:38:5: error: implicit declaration of function 'bubblesort' [-Wimplicit-function-declaration]
   38 |   s=bubblesort(a,N);
      |     ^~~~~~~~~~
Language: C

#include <stdio.h>

int bubbleSort( int A[], int N, int wa )
{
   int i, j, v;

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

int syuturyoku( int A[], int N )
{
   int i;
   for ( i = 0; i < N; i++ ) {
      if ( i > 0 ) {
         printf(" ");
      }
      printf("&d", A[ i ]);
   }
   printf("\n");
}

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

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

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:41:4: error: too few arguments to function 'bubbleSort'
   41 |    bubbleSort( A, N );
      |    ^~~~~~~~~~
main.c:3:5: note: declared here
    3 | int bubbleSort( int A[], int N, int wa )
      |     ^~~~~~~~~~
main.c:43:28: error: passing argument 1 of 'bubbleSort' makes pointer from integer without a cast [-Wint-conversion]
   43 |    printf("%d", bubbleSort(wa));
      |                            ^~
      |                            |
      |                            int
main.c:3:21: note: expected 'int *' but argument is of type 'int'
    3 | int bubbleSort( int A[], int N, int wa )
      |                 ~~~~^~~
main.c:43:17: error: too few arguments to function 'bubbleSort'
   43 |    printf("%d", bubbleSort(wa));
      |                 ^~~~~~~~~~
main.c:3:5: note: declared here
    3 | int bubbleSort( int A[], int N, int wa )
      |     ^~~~~~~~~~
main.c:45:11: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   45 |    return 0;
      |           ^
main.c:32:6: note: declared here
   32 | void main()
      |      ^~~~
Language: C

#include <stdio.h>

int bubbleSort( int A[], int N, int wa )
{
   int i, j, v;

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

int syuturyoku( int A[], int N )
{
   int i;
   for ( i = 0; i < N; i++ ) {
      if ( i > 0 ) {
         printf(" ");
      }
      printf("&d", A[ i ]);
   }
   printf("\n");
}

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

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

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:41:4: error: too few arguments to function 'bubbleSort'
   41 |    bubbleSort( A, N );
      |    ^~~~~~~~~~
main.c:3:5: note: declared here
    3 | int bubbleSort( int A[], int N, int wa )
      |     ^~~~~~~~~~
main.c:43:30: error: passing argument 1 of 'bubbleSort' makes pointer from integer without a cast [-Wint-conversion]
   43 |    printf("%d\n", bubbleSort(wa));
      |                              ^~
      |                              |
      |                              int
main.c:3:21: note: expected 'int *' but argument is of type 'int'
    3 | int bubbleSort( int A[], int N, int wa )
      |                 ~~~~^~~
main.c:43:19: error: too few arguments to function 'bubbleSort'
   43 |    printf("%d\n", bubbleSort(wa));
      |                   ^~~~~~~~~~
main.c:3:5: note: declared here
    3 | int bubbleSort( int A[], int N, int wa )
      |     ^~~~~~~~~~
main.c:45:11: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   45 |    return 0;
      |           ^
main.c:32:6: note: declared here
   32 | void main()
      |      ^~~~
Language: C

#include <stdio.h>

int main(void) {
	
	int i, n, s, f, count = 0;
	int a[100];
	
	scanf("%d", &n);
	for( i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	
	f = 1;
	while(f){
		f = 0;
			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;
					f = 1;
					count = count + 1;
				}
			}
	}
	
	for(i = 0; i < n; i++){
           if( i > 0){
                puts(" ");
		printf("%d", a[i]);
	}
		printf("%d\n", 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, flag, count, A;
  int data[99];
  count = 0;
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", data[i]);
  }

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

Compiler output:
main.c: In function 'main':
main.c:17:10: error: expected '(' before 'data'
   17 |       if data[j] < data[j-1]{
      |          ^~~~
      |          (
main.c:26:24: error: expected ';' before 'for'
   26 |   printf("%d", data[0])
      |                        ^
      |                        ;
   27 |   for(i = 1; i < n; i++){
      |   ~~~                   
main.c:30:3: error: expected declaration or statement at end of input
   30 |   printf("\n%d\n", ocunt);
      |   ^~~~~~
Language: C

#include<stdio.h>

int main(){
  int n, i, j, flag, count, A;
  int data[99];
  count = 0;
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", data[i]);
  }

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

Compiler output:
main.c: In function 'main':
main.c:17:10: error: expected '(' before 'data'
   17 |       if data[j] < data[j-1]{
      |          ^~~~
      |          (
main.c:26:24: error: expected ';' before 'for'
   26 |   printf("%d", data[0])
      |                        ^
      |                        ;
   27 |   for(i = 1; i < n; i++){
      |   ~~~
Language: C

#include<stdio.h>

int main(){
  int n, i, j, flag, count, A;
  int data[99];
  count = 0;
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", data[i]);
  }

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

Compiler output:
main.c: In function 'main':
main.c:17:10: error: expected '(' before 'data'
   17 |       if data[j] < data[j-1]{
      |          ^~~~
      |          (
main.c:28:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   28 |     pirntf(" %d", data[i]);
      |     ^~~~~~
      |     printf
Language: C

#include<stdio.h>

int main(){
  int n, i, j, flag, count, A;
  int data[99];
  count = 0;
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", data[i]);
  }

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

Compiler output:
main.c: In function 'main':
main.c:28:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   28 |     pirntf(" %d", data[i]);
      |     ^~~~~~
      |     printf
Language: C

#include <stdio.h>

int main()
{
        int v,n,i,j,A[1000];
        int count,c;
           c=0;
          j = n-1;
         scanf("%d",&n);
         for(i=0;i<n;i++){
         scanf("%d",&A[i]);
         }
          
          while(c<n){
          	
          ???while(j>=c){
          	if(A[j]???A[j+1]){
          v=A[j];
          ???A[j]=A[j+1];
          A[j+1]=v;
          ???count++;}
          
          j--;
          ???}
          ???c++;
          }
          for(i=0;i<n-1;i++){
          printf("%d+ +",A[i]);}
          ???printf("%d\n",A[n]);
          printf("%d",count);
          
        return 0;
}



 

Compiler output:
main.c: In function 'main':
main.c:16:11: error: expected expression before '?' token
   16 |           ???while(j>=c){
      |           ^
main.c:29:11: error: expected expression before '?' token
   29 |           ???printf("%d\n",A[n]);
      |           ^
Language: C

#include <stdio.h>

int main()
{
        int v,n,i,j,A[1000];
        int count,c;
           c=0;
          j = n-1;
         scanf("%d",&n);
         for(i=0;i<n;i++){
         scanf("%d",&A[i]);
         }
          
          while(c<n){	
          ???while(j>=c){
          if(A[j]???A[j+1]){
          v=A[j];
          ???A[j]=A[j+1];
          A[j+1]=v;
          ???count++;}
          j--;
          ???}
          ???c++;
          }
          for(i=0;i<n-1;i++){
          printf("%d+ +",A[i]);}
          ???printf("%d\n",A[n]);
          printf("%d",count);
          
        return 0;
}



 

Compiler output:
main.c: In function 'main':
main.c:15:11: error: expected expression before '?' token
   15 |           ???while(j>=c){
      |           ^
main.c:27:11: error: expected expression before '?' token
   27 |           ???printf("%d\n",A[n]);
      |           ^
Language: C

#include <stdio.h>

int main()
{
        int v,n,i,j,A[1000];
        int count,c=1;
           c=0;
          j = n-1;
         scanf("%d",&n);
         for(i=0;i<n;i++){
         scanf("%d",&A[i]);
         }
          
          while(j){
          j=0
          ???for(i=1;i<n;i++)
          if(A[i]<A[i-1]){
          v=A[i];
          ???A[i]=A[i-1];
          A[i-1]=v;
          ???count++;
          j=1;
          }
          ???}
          }
          for(i=0;i<n;i++){
          printf("%d ",A[i]);
          if(i==n-1)???printf("%d\n",A[i]);}
          printf("%d\n",count);
          
        return 0;
}



 
    
   

Compiler output:
main.c: In function 'main':
main.c:16:12: error: expected expression before '?' token
   16 |           ???for(i=1;i<n;i++)
      |            ^
main.c: At top level:
main.c:26:11: error: expected identifier or '(' before 'for'
   26 |           for(i=0;i<n;i++){
      |           ^~~
main.c:26:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   26 |           for(i=0;i<n;i++){
      |                    ^
main.c:26:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   26 |           for(i=0;i<n;i++){
      |                        ^~
main.c:29:18: error: expected declaration specifiers or '...' before string constant
   29 |           printf("%d\n",count);
      |                  ^~~~~~
main.c:29:25: error: unknown type name 'count'
   29 |           printf("%d\n",count);
      |                         ^~~~~
main.c:31:9: error: expected identifier or '(' before 'return'
   31 |         return 0;
      |         ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
   32 | }
      | ^
Language: C


#include<stdio.h>

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

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

return 0;
}

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


#include<stdio.h>

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

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

return 0;
}

Compiler output:
main.c:21:2: error: expected identifier or '(' before 'for'
   21 |  for(i=0;i<n;i++){
      |  ^~~
main.c:21:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   21 |  for(i=0;i<n;i++){
      |           ^
main.c:21:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   21 |  for(i=0;i<n;i++){
      |               ^~
main.c:23:1: error: expected identifier or '(' before 'if'
   23 | if(i==n-1)printf("%d\n",A[i]);
      | ^~
main.c:24:8: error: expected declaration specifiers or '...' before string constant
   24 | printf("%d\n",count);
      |        ^~~~~~
main.c:24:15: error: unknown type name 'count'
   24 | printf("%d\n",count);
      |               ^~~~~
main.c:26:1: error: expected identifier or '(' before 'return'
   26 | return 0;
      | ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

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

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

 return 0;
}

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

#include <stdio.h>
??
int main(){
??
int i,j;
int A[101];
int len, tmp;
int count=0;

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

tmp = A[j];
A[j] = A[j-1];
A[j-1] = tmp;
count++;

}
??
}
??
}

for(i=1; i<=len; i++){

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

if(i!=len){
printf(" \n");
}

}

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

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

#include<stdio.h>

int main(){

int n;

int x[100];

int i;

int a;

int j, k;

int count = 0;

scanf("%d", &n);

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

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

}

for(j=n-1; j>=0; j--){

for(k=n-1; k>=0; k--){

if(x[k-1]>x[k]){

a = x[k-1];

x[k-1] = x[k];

x[k] = a;

count++;

    }

   }

  }

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

if(i!=0 && i!=n){

printf(" ");

  }

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

   }

printf("\n");

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

return 0;
}

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

#include<stdio.h>

void bubbleSort(int A[], int N){
  int i, j, k, count = 0;
  for( i = 0; i < N; i++ ){
    for(j = i + 1 ; j < N; j++ ){
      if(A[i] > A[j]){
        k = A[j];
        A[j] = A[i];
        A[i] = k;
        count += 1;
      }
    }
  }
  space(A, N);
}

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

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:15:3: error: implicit declaration of function 'space' [-Wimplicit-function-declaration]
   15 |   space(A, N);
      |   ^~~~~
main.c: At top level:
main.c:18:6: warning: conflicting types for 'space'; have 'void(int *, int)'
   18 | void space(int A[], int N){
      |      ^~~~~
main.c:15:3: note: previous implicit declaration of 'space' with type 'void(int *, int)'
   15 |   space(A, N);
      |   ^~~~~
main.c: In function 'main':
main.c:37:9: error: void value not ignored as it ought to be
   37 |   count = bubbleSort(A, N);
      |         ^
Language: C

#include<stdio.h>

void bubbleSort(int a[],int n){
  int flag = 1;
int i,j,n,v,a[100]; 
int c = 0;


    while ( flag == 1) {
        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;
                c++;
                flag = 1;
            }
        }
    }
}

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

    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]);
    }
    printf("%d\n", c);
    return 0;
}
 

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:9: error: 'n' redeclared as different kind of symbol
    5 | int i,j,n,v,a[100];
      |         ^
main.c:3:29: note: previous definition of 'n' with type 'int'
    3 | void bubbleSort(int a[],int n){
      |                         ~~~~^
main.c:5:13: error: 'a' redeclared as different kind of symbol
    5 | int i,j,n,v,a[100];
      |             ^
main.c:3:21: note: previous definition of 'a' with type 'int *'
    3 | void bubbleSort(int a[],int n){
      |                 ~~~~^~~
Language: C

#include<stdio.h>

void bubbleSort(int a[],int n){
  int flag = 1;
int i,j,n,v,a[100]; 
int c = 0;


    while ( flag == 1) {
        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;
                c++;
                flag = 1;
            }
        }
    }
}

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

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

 bubbleSort(a,n);

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

Compiler output:
main.c: In function 'bubbleSort':
main.c:5:9: error: 'n' redeclared as different kind of symbol
    5 | int i,j,n,v,a[100];
      |         ^
main.c:3:29: note: previous definition of 'n' with type 'int'
    3 | void bubbleSort(int a[],int n){
      |                         ~~~~^
main.c:5:13: error: 'a' redeclared as different kind of symbol
    5 | int i,j,n,v,a[100];
      |             ^
main.c:3:21: note: previous definition of 'a' with type 'int *'
    3 | void bubbleSort(int a[],int n){
      |                 ~~~~^~~
Language: C


 #include<stdio.h>

void bubbleSort(int a[],int n)
{
  int flag = 1;
int i,j,v; 
int c = 0;


    while ( flag == 1) {
        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;
                c++;
                flag = 1;
            }
        }
    }
}

int main(void){
 int flag = 1
int i,j,n,v,a[100]; 
int c =0;

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

 bubbleSort(a,n);


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

Compiler output:
main.c: In function 'main':
main.c:27:1: error: expected ',' or ';' before 'int'
   27 | int i,j,n,v,a[100];
      | ^~~
main.c:30:18: error: 'n' undeclared (first use in this function)
   30 |     scanf("%d", &n);
      |                  ^
main.c:30:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:12: error: 'i' undeclared (first use in this function)
   31 |      for ( i = 0; i < n; i++ ) scanf("%d", &a[i]);
      |            ^
main.c:31:45: error: 'a' undeclared (first use in this function)
   31 |      for ( i = 0; i < n; i++ ) scanf("%d", &a[i]);
      |                                             ^
Language: C


 #include<stdio.h>


int main(void){
 int flag = 1
int i,j,n,v,a[100]; 
int c =0;

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

 bubbleSort(a,n);


   printf("%d",a[0]);
    for ( i = 1; i < n; i++ ) {
        printf(" %d\n", a[i]);
    }
    printf("%d\n", c);
    return 0;
}
 void bubbleSort(int a[],int n)
{
  int flag = 1;
int i,j,v; 
int c = 0;


    while ( flag == 1) {
        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;
                c++;
                flag = 1;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:7:1: error: expected ',' or ';' before 'int'
    7 | int i,j,n,v,a[100];
      | ^~~
main.c:10:18: error: 'n' undeclared (first use in this function)
   10 |     scanf("%d", &n);
      |                  ^
main.c:10:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:12: error: 'i' undeclared (first use in this function)
   11 |      for ( i = 0; i < n; i++ ) scanf("%d", &a[i]);
      |            ^
main.c:11:45: error: 'a' undeclared (first use in this function)
   11 |      for ( i = 0; i < n; i++ ) scanf("%d", &a[i]);
      |                                             ^
main.c:13:2: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   13 |  bubbleSort(a,n);
      |  ^~~~~~~~~~
main.c: At top level:
main.c:23:7: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
   23 |  void bubbleSort(int a[],int n)
      |       ^~~~~~~~~~
main.c:13:2: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
   13 |  bubbleSort(a,n);
      |  ^~~~~~~~~~
Language: C

#include<stdio.h>


int main(void){
 int flag = 1;
int i,j,n,v,a[100]; 
int c =0;

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



    

    printf("%d\n", c);
    return 0;
}
 
void bubbleSort(int a[],int n)
{
  int flag = 1;
int i,j,v; 
int c = 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;
                c++;
                flag = 1;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   14 | bubbleSort(a,n)
      | ^~~~~~~~~~
main.c:14:16: error: expected ';' before 'for'
   14 | bubbleSort(a,n)
      |                ^
      |                ;
   15 | 
   16 |     for ( i = 0; i < n; i++ ) {
      |     ~~~         
main.c: At top level:
main.c:32:6: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
   32 | void bubbleSort(int a[],int n)
      |      ^~~~~~~~~~
main.c:14:1: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
   14 | bubbleSort(a,n)
      | ^~~~~~~~~~
Language: C

#include<stdio.h>


int main(void){
 int flag = 1;
int i,j,N,v,a[100]; 
int c =0;

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



    

    printf("%d\n", c);
    return 0;
}
 
void bubbleSort(int a[],int N)
{
  int flag = 1;
int i,j,v; 
int c = 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;
                c++;
                flag = 1;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
   14 | bubbleSort(a,N);
      | ^~~~~~~~~~
main.c:21:8: error: expected '(' before '{' token
   21 | else if{ printf(" ");
      |        ^
      |        (
main.c: At top level:
main.c:33:6: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
   33 | void bubbleSort(int a[],int N)
      |      ^~~~~~~~~~
main.c:14:1: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
   14 | bubbleSort(a,N);
      | ^~~~~~~~~~
Language: C

#include<stdio.h>


int main(void){
 int flag = 1;
int i,j,n,v,a[10000]; 
int c =0;

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

        printf("%d\n", a[i]);
}
printf("\n");
  
    

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

Compiler output:
main.c:28:5: error: expected identifier or '(' before 'for'
   28 |     for ( i = 0; i < n; i++ ) {
      |     ^~~
main.c:28:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   28 |     for ( i = 0; i < n; i++ ) {
      |                    ^
main.c:28:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   28 |     for ( i = 0; i < n; i++ ) {
      |                          ^~
main.c:35:8: error: expected declaration specifiers or '...' before string constant
   35 | printf("\n");
      |        ^~~~
main.c:39:12: error: expected declaration specifiers or '...' before string constant
   39 |     printf("%d\n",c);
      |            ^~~~~~
main.c:39:19: error: unknown type name 'c'
   39 |     printf("%d\n",c);
      |                   ^
main.c:40:5: error: expected identifier or '(' before 'return'
   40 |     return 0;
      |     ^~~~~~
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C

#include<stdio.h>

int main(){

????int n, k, A[100];
????int count = 0;
??
????scanf("%d", &n);
????for ( i = 0; i < n; i++ ){
????  scanf("%d", &A[ i ] );
????}
??????
  for ( i = n-1; i > 0; i-- ){
    if(A[i] < A[i-1]){
      k = A[i];
      A[i] = A[i-1];
      A[i-1] = k;
      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:5:1: error: expected expression before '?' token
    5 | ????int n, k, A[100];
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????int count = 0;
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ??
      | ^
main.c:8:18: error: 'n' undeclared (first use in this function)
    8 | ????scanf("%d", &n);
      |                  ^
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:1: error: expected expression before '?' token
    9 | ????for ( i = 0; i < n; i++ ){
      | ^
main.c:26:16: error: 'count' undeclared (first use in this function)
   26 |   printf("%d", count);
      |                ^~~~~
Language: C

#include<stdio.h>

int main(){

????int n, k, A[100];
????int count = 0;
??
????scanf("%d", &n);
????for ( i = 0; i < n; i++ ){
????  scanf("%d", &A[ i ] );
????}
??????
  for ( i = n-1; i >= 0; i-- ){
    if(A[i] < A[i-1]){
      k = A[i];
      A[i] = A[i-1];
      A[i-1] = k;
      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:5:1: error: expected expression before '?' token
    5 | ????int n, k, A[100];
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????int count = 0;
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ??
      | ^
main.c:8:18: error: 'n' undeclared (first use in this function)
    8 | ????scanf("%d", &n);
      |                  ^
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:1: error: expected expression before '?' token
    9 | ????for ( i = 0; i < n; i++ ){
      | ^
main.c:26:16: error: 'count' undeclared (first use in this function)
   26 |   printf("%d", count);
      |                ^~~~~
Language: C

#include<stdio.h>

int main(){

????int n, k, A[100];
????int count = 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 >= 0; j-- ){
      if(A[j] < A[j-1]){
        k = A[j];
        A[j] = A[j-1];
        A[j-1] = k;
        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:5:1: error: expected expression before '?' token
    5 | ????int n, k, A[100];
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????int count = 0;
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ??
      | ^
main.c:8:18: error: 'n' undeclared (first use in this function)
    8 | ????scanf("%d", &n);
      |                  ^
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:1: error: expected expression before '?' token
    9 | ????for ( i = 0; i < n; i++ ){
      | ^
main.c:27:16: error: 'count' undeclared (first use in this function)
   27 |   printf("%d", count);
      |                ^~~~~
Language: C

#include<stdio.h>
 
int main(void){
int n,flag,count,A;
int data[99];
count=0;
scanf("%d",&n);
int i,j;   
for(i=0;i<n;i++){
scanf("%d",&data[i]);
}
flag=1;
while(flag){
fla =0;
for(j=n-1; j>=1;j--){
if(data[j]<data[j-1]){
A=data[j];
data[j]=data[j-1];
data[j-1]=A;
count++;
flag=1;
}
}
}
printf("%d",data[0]);
for(i=1; i<n;i++){
printf(" %d",data[i]);
}
printf("\n%d\n",count);
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: 'fla' undeclared (first use in this function); did you mean 'flag'?
   14 | fla =0;
      | ^~~
      | flag
main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
int main(void){
int n,flag,count,A;
int data[99];
count=0;
scanf("%d",&n);
int i,j;   
for(i=0;i<n;i++){
scanf("%d",&data[i]);
}
fla=1;
while(flag){
fla =0;
for(j=n-1; j>=1;j--){
if(data[j]<data[j-1]){
A=data[j];
data[j]=data[j-1];
data[j-1]=A;
count++;
flag=1;
}
}
}
printf("%d",data[0]);
for(i=1; i<n;i++){
printf(" %d",data[i]);
}
printf("\n%d\n",count);
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: 'fla' undeclared (first use in this function); did you mean 'flag'?
   12 | fla=1;
      | ^~~
      | flag
main.c:12:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
int main(void){
int n,flag,count,A;
int data[99];
count=0;
scanf("%d",&n);
int i,j;   
for(i=0;i<n;i++){
scanf("%d",&data[i]);
}
flag=1;
while(flag){
flag0;
for(j=n-1; j>=1;j--){
if(data[j]<data[j-1]){
A=data[j];
data[j]=data[j-1];
data[j-1]=A;
count++;
flag=1;
}
}
}
printf("%d",data[0]);
for(i=1; i<n;i++){
printf(" %d",data[i]);
}
printf("\n%d\n",count);
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: 'flag0' undeclared (first use in this function); did you mean 'flag'?
   14 | flag0;
      | ^~~~~
      | flag
main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void){
	int X,Y;
	int A[1000];
	int i=0;
	while((scanf("%d",&X))!='\n'){
		int N=X; //????´???°
	}
	while((scanf("%d",&Y))!=EOF){
		A[i] = Y;
		i++;
	}
	int flag=1;
	int change=0; //???????????°
	while(flag){
		flag=0;
		for(int j=N-1; i>=1; j--){
			if(A[j]<A[j-1]){
				int stock = A[j];
				A[j] = A[j-1];
				A[j-1] = stock;
				flag=1; 
				change++;
			}
		}
	}
	for(i=0; i<N; i++){
		printf("%d ",A[i]);
	}
	printf("\n");
	printf("%d",change);
}

Compiler output:
main.c: In function 'main':
main.c:18:27: error: 'N' undeclared (first use in this function)
   18 |                 for(int j=N-1; i>=1; j--){
      |                           ^
main.c:18:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C

//2-bubbleSort

int main(){
  int A[100];
  int N;;
  fgets(A, 100, stdin);
  bubbleSort(A, N);
}

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

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    6 |   fgets(A, 100, stdin);
      |   ^~~~~
main.c:6:17: error: 'stdin' undeclared (first use in this function)
    6 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | //2-bubbleSort
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
    6 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:7:3: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
    7 |   bubbleSort(A, N);
      |   ^~~~~~~~~~
main.c: At top level:
main.c:10:6: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
   10 | void bubbleSort(int A[], int N){
      |      ^~~~~~~~~~
main.c:7:3: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
    7 |   bubbleSort(A, N);
      |   ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:15:9: error: 'temp' undeclared (first use in this function); did you mean 'tmp'?
   15 |         temp = A[j-1];
      |         ^~~~
      |         tmp
Language: C

int main(){
  int A[100];
  fgets(A, 100, stdin);
  bubbleSort(A, N);
}

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

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    3 |   fgets(A, 100, stdin);
      |   ^~~~~
main.c:3:17: error: 'stdin' undeclared (first use in this function)
    3 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:17: note: each undeclared identifier is reported only once for each function it appears in
    3 |   fgets(A, 100, stdin);
      |                 ^~~~~
main.c:4:3: error: implicit declaration of function 'bubbleSort' [-Wimplicit-function-declaration]
    4 |   bubbleSort(A, N);
      |   ^~~~~~~~~~
main.c:4:17: error: 'N' undeclared (first use in this function)
    4 |   bubbleSort(A, N);
      |                 ^
main.c: At top level:
main.c:7:6: warning: conflicting types for 'bubbleSort'; have 'void(int *, int)'
    7 | void bubbleSort(int A[], int N){
      |      ^~~~~~~~~~
main.c:4:3: note: previous implicit declaration of 'bubbleSort' with type 'void(int *, int)'
    4 |   bubbleSort(A, N);
      |   ^~~~~~~~~~
main.c: In function 'bubbleSort':
main.c:12:9: error: 'temp' undeclared (first use in this function); did you mean 'tmp'?
   12 |         temp = A[j-1];
      |         ^~~~
      |         tmp