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

#include <iostream>
using namespace std;


int main()
{
  int N , A[100] , cnt = 0;

  cin >> N;
  for( int i = 0; i < N; i++ )
    {
      cin >> A[i];
    }
  
  for( int i = 0; i < N; i++ )
    {
      for ( int j = 0; j < N-1; j++ )
	{
	  if( A[j] > A[j+1])
	    {
	      swap(A[j],A[j+1]);
	      cnt++;
	    }
	}
    }

   for( int i = 0; i < N; i++ )
    {
      cout <<  A[i];
      if( i != N-1 ) cout << " ";
      
    }
   cout << endl;
   cout << cnt << endl;
   

Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: expected '}' at end of input
   34 |    cout << cnt << endl;
      |                        ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    int i, j, N, count=0;
    cin >> N;
    for(i=0;i<N;i++)
        cin >> s[i];
    for(i=0;i<s.length();i++){
        for(j=s.length()-1;j>=i+1;j--){
            if(s[j]<s[j-1]){
                a=s[j];
                s[j]=s[j-1];
                s[j-1]=a;
                count++;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'a' was not declared in this scope
   14 |                 a=s[j];
      |                 ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    int i, j, N, count=0;
    char a;
    cin >> N;
    for(i=0;i<N;i++)
        cin >> s[i];
    for(i=0;i<N;i++){
        for(j=N-1;j>=i+1;j--){
            if(s[j]<s[j-1]){
                a=s[j];
                s[j]=s[j-1];
                s[j-1]=a;
                count++;
            }
        }
    }
    for(i=0;i<N;i++) {
        cout << s[i];
        if(i=N-1) cout << endl;
        else cout << " ";
    }
    cout << count << endl;
    cout << count
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expected ';' before '}' token
   28 |     cout << count
      |                  ^
      |                  ;
   29 | }
      | ~
Language: C++


#include <stdio.h>


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

void bubbleSort(int A[],int N){
	
	bool flag=1;
	int count=0;
	while(flag){
		flag=0;
		for(int j=N-1;j>0;j--){
			if(A[j]<A[j-1]){
				int tmp;
				tmp = A[j];
				A[j] = A[j-1];
				A[j-1] = tmp;
				flag = 1;
				count++;
			}
		}
	}
	trace(A,N);
	cout << count;
}

int main(){

	int N;
	int A[100];

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

	return 0;
}

Compiler output:
a.cc: In function 'void bubbleSort(int*, int)':
a.cc:31:9: error: 'cout' was not declared in this scope; did you mean 'count'?
   31 |         cout << count;
      |         ^~~~
      |         count
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;


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

int main(){
   int N,i,count,A[100];
   cin >> N;
   for(i=0;i<N;i++)cin >> A[i];
   
   count = bubbleSort(A,N);
   
   for(i=0;i<N;i++){
     if(i)cout << " ";
     cout << a[i];
   }

   cout << endl;
   cout << count << endl;

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: 'a' was not declared in this scope
   32 |      cout << a[i];
      |              ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	int data[100];
	ll int cnt = 0;
	int n;
	cin >> n;
	REP(i,n) cin >> data[i];
	REP(i,n-1){
		REP(j,i+1,n){
			if(data[i]>data[j]) {
				swap(data[i],data[j]);
				cnt++;
			}
		}
	}
	REP(i,n){
		if(i!=n-1) cout << data[i] << " ";
		else cout << data[i] << endl;
	}
	cout << cnt << endl;
}

Compiler output:
a.cc:33:28: error: macro "REP" passed 3 arguments, but takes just 2
   33 |                 REP(j,i+1,n){
      |                            ^
a.cc:19:9: note: macro "REP" defined here
   19 | #define REP(i,n) for(int i=0;i<(int)(n);i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:33:17: error: 'REP' was not declared in this scope
   33 |                 REP(j,i+1,n){
      |                 ^~~
Language: C++

#include<stdio.h>

int main()
{
    int n,i;
    scanf("%d",&n);
    int material[*n];
    for(i=0;i<=n-1;i++)
    {
         scanf("%d ",&material[i]);
    }
    int j,k,count=0;
    for(j=1;j<=n-1;j++)
    {
        if(material[j]<material[j-1]) 
        {
            k=material[j-1];
            material[j-1]=material[j];
            material[j]=k;
            count++;
        }
    }
    printf("%d\n",material);
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid type argument of unary '*' (have 'int')
    7 |     int material[*n];
      |                  ^~
a.cc:10:23: error: 'material' was not declared in this scope
   10 |          scanf("%d ",&material[i]);
      |                       ^~~~~~~~
a.cc:15:12: error: 'material' was not declared in this scope
   15 |         if(material[j]<material[j-1])
      |            ^~~~~~~~
a.cc:23:19: error: 'material' was not declared in this scope
   23 |     printf("%d\n",material);
      |                   ^~~~~~~~
Language: C++

#include<stdio.h>

int main()
{
    int n,i;
    scanf("%d",&n);
    int material[101];
    for(i=0;i<=n-1;i++)
    {
         scanf("%d ",&material[i]);
    }
    if(n==1) 
    {
        printf("%d\n",material);
        printf("1\n");
        break;
    }
    int j,k,count=0;
    for(j=1;j<=n-1;j++)
    {
        if(material[j]<material[j-1]) 
        {
            k=material[j-1];
            material[j-1]=material[j];
            material[j]=k;
            count++;
        }
    }
    printf("%d\n",material);
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: break statement not within loop or switch
   16 |         break;
      |         ^~~~~
Language: C++

#include <stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'n' was not declared in this scope
    5 |  scanf("%d",&n);
      |              ^
a.cc:7:19: error: expected ')' before ';' token
    7 |   scanf("%d",&A[i];
      |        ~          ^
      |                   )
a.cc:11:11: error: expected ';' before 'for'
   11 |   flag = 0
      |           ^
      |           ;
   12 |   for(int j = N-1;j>= 1;j--){
      |   ~~~      
a.cc:12:19: error: 'j' was not declared in this scope
   12 |   for(int j = N-1;j>= 1;j--){
      |                   ^
a.cc: At global scope:
a.cc:22:2: error: expected unqualified-id before 'for'
   22 |  for(int i=0;i<N;i++){
      |  ^~~
a.cc:22:14: error: 'i' does not name a type
   22 |  for(int i=0;i<N;i++){
      |              ^
a.cc:22:18: error: 'i' does not name a type
   22 |  for(int i=0;i<N;i++){
      |                  ^
a.cc:25:8: error: expected constructor, destructor, or type conversion before '(' token
   25 |  printf("\n%d\n",cnt);
      |        ^
a.cc:26:2: error: expected unqualified-id before 'return'
   26 |  return 0;
      |  ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected ')' before ';' token
    7 |   scanf("%d",&A[i];
      |        ~          ^
      |                   )
a.cc:11:11: error: expected ';' before 'for'
   11 |   flag = 0
      |           ^
      |           ;
   12 |   for(int j = N-1;j>= 1;j--){
      |   ~~~      
a.cc:12:19: error: 'j' was not declared in this scope
   12 |   for(int j = N-1;j>= 1;j--){
      |                   ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


void print(int A[], int N, int cnt){

for(int i = 0; i < N; i++){
  cout << A[i];
  if(i != N-1){
    cout << " " <<;
  }else{
    cout << endl;
  }
  cout << cnt;
}

void BSort(int A[], int N){
  int i, j, flag, cnt;

  for(i=0; i<N; i++){
    while(flag){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }
  }
}




int main(){
  int i, j, flag, cnt, N, A[100];

  cin >> N;
  for(i=0; i<N; i++) cin >> A[i];

  BSort(A, N);
  print(A, N, cnt);
}

Compiler output:
a.cc: In function 'void print(int*, int, int)':
a.cc:12:19: error: expected primary-expression before ';' token
   12 |     cout << " " <<;
      |                   ^
a.cc:19:27: error: a function-definition is not allowed here before '{' token
   19 | void BSort(int A[], int N){
      |                           ^
a.cc:39:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   39 | int main(){
      |         ^~
a.cc:39:9: note: remove parentheses to default-initialize a variable
   39 | int main(){
      |         ^~
      |         --
a.cc:39:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:39:11: error: a function-definition is not allowed here before '{' token
   39 | int main(){
      |           ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:7:36: note: to match this '{'
    7 | void print(int A[], int N, int cnt){
      |                                    ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


void print(int A[], int N, int cnt){

for(int i = 0; i < N; i++){
  cout << A[i];
  if(i != N-1){
    cout << " " ;
  }else{
    cout << endl;
  }
  cout << cnt;
}

void BSort(int A[], int N){
  int i, j, flag, cnt;

  for(i=0; i<N; i++){
    while(flag){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }
  }
}




int main(){
  int i, j, flag, cnt, N, A[100];

  cin >> N;
  for(i=0; i<N; i++) cin >> A[i];

  BSort(A, N);
  print(A, N, cnt);
}

Compiler output:
a.cc: In function 'void print(int*, int, int)':
a.cc:19:27: error: a function-definition is not allowed here before '{' token
   19 | void BSort(int A[], int N){
      |                           ^
a.cc:39:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   39 | int main(){
      |         ^~
a.cc:39:9: note: remove parentheses to default-initialize a variable
   39 | int main(){
      |         ^~
      |         --
a.cc:39:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:39:11: error: a function-definition is not allowed here before '{' token
   39 | int main(){
      |           ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:7:36: note: to match this '{'
    7 | void print(int A[], int N, int cnt){
      |                                    ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


void print(int A[], int N, int cnt){

for(int i = 0; i < N; i++){
  cout << A[i];
  if(i != N-1){
    cout << " " ;
  }else{
    cout << endl;
  }
  cout << cnt;
}

void BSort(int A[], int N) {
  int i, j, flag, cnt;

  for(i=0; i<N; i++){
    while(flag){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }
  }
}




int main(){
  int i, j, flag, cnt, N, A[100];

  cin >> N;
  for(i=0; i<N; i++) {cin >> A[i]};

  BSort(A, N);
  print(A, N, cnt);
}

Compiler output:
a.cc: In function 'void print(int*, int, int)':
a.cc:19:28: error: a function-definition is not allowed here before '{' token
   19 | void BSort(int A[], int N) {
      |                            ^
a.cc:39:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   39 | int main(){
      |         ^~
a.cc:39:9: note: remove parentheses to default-initialize a variable
   39 | int main(){
      |         ^~
      |         --
a.cc:39:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:39:11: error: a function-definition is not allowed here before '{' token
   39 | int main(){
      |           ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:7:36: note: to match this '{'
    7 | void print(int A[], int N, int cnt){
      |                                    ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


void prnt(int A[], int N, int cnt){

for(int i = 0; i < N; i++){
  cout << A[i];
  if(i != N-1){
    cout << " " ;
  }else{
    cout << endl;
  }
  cout << cnt;
}

void BSort(int A[], int N) {
  int i, j, flag, cnt;
  cnt =0;

  for(i=0; i<N; i++){
    while(flag){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }
  }

  prnt(A, N, cnt);
}




int main(){
  int i, j, flag, cnt, N, A[100];

  cin >> N;
  for(i=0; i<N; i++) {cin >> A[i]};

  BSort(A, N);
}

Compiler output:
a.cc: In function 'void prnt(int*, int, int)':
a.cc:19:28: error: a function-definition is not allowed here before '{' token
   19 | void BSort(int A[], int N) {
      |                            ^
a.cc:42:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   42 | int main(){
      |         ^~
a.cc:42:9: note: remove parentheses to default-initialize a variable
   42 | int main(){
      |         ^~
      |         --
a.cc:42:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:42:11: error: a function-definition is not allowed here before '{' token
   42 | int main(){
      |           ^
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:7:35: note: to match this '{'
    7 | void prnt(int A[], int N, int cnt){
      |                                   ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


void prnt(int A[], int N, int cnt){

for(int i = 0; i < N; i++){
  cout << A[i];
  if(i != N-1){
    cout << " " ;
  }else{
    cout << endl;
  }
  cout << cnt << endl;
}}

void BSort(int A[], int N) {
  int i, j, cnt;
  bool flag;
  cnt =0;
  bool flag = 1
  for(i=0; flag; i++){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }
  }

  prnt(A, N, cnt);
}




int main(){
  int i, j, cnt, N, A[100];
  bool flag;
  
  cin >> N;
  for(i=0; i<N; i++) {cin >> A[i];};

  BSort(A, N);
}

Compiler output:
a.cc: In function 'void BSort(int*, int)':
a.cc:23:8: error: redeclaration of 'bool flag'
   23 |   bool flag = 1
      |        ^~~~
a.cc:21:8: note: 'bool flag' previously declared here
   21 |   bool flag;
      |        ^~~~
a.cc:24:21: error: expected ';' before ')' token
   24 |   for(i=0; flag; i++){
      |                     ^
      |                     ;
a.cc: At global scope:
a.cc:36:7: error: expected constructor, destructor, or type conversion before '(' token
   36 |   prnt(A, N, cnt);
      |       ^
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;


int BSort(int A[], int N) {
  int i, j, cnt;
  bool flag;
  cnt =0;
  flag = 1;
  for(i=0; flag; i++){
      flag = 0;
      for(j = N-1; j > i; j--){
        if(A[j] < A[j-1]){
          swap(A[j], A[j-1]);
          flag = 1;
          cnt++;
        }
      }
    }

    return cnt;
  }

int main(){
  int cnt, N, A[100];
  
  cin >> N;
  for(i=0; i<N; i++) {cin >> A[i];}

  cnt = BSort(A, N);
  
  for(int i = 0; i < N; i++){
    cout << A[i];
    if(i != N-1){
      cout << " "; }
    }
      cout << endl;
    cout << cnt << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:7: error: 'i' was not declared in this scope
   30 |   for(i=0; i<N; i++) {cin >> A[i];}
      |       ^
a.cc: At global scope:
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

//??????????????????
void BabbleSort(int N, vector<int> array){

	int v,count=0;

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

	//?????????????????¨?????????????????°for(i)?????????????????°??????
	for (int k = 0; k < N; k++){
		cout << array[k];
		if (k != N - 1)cout << " ";
	}cout << endl;

	cout << count << endl;



}



int main(){

	int N,Num;
	cin >> N;

	vector<int> array(N, 0);

	for (int i = 0; i < N; i++){
		cin >> Num;
		array[i] = Num;
	}


	BabbleSort(N,array);


	return 0;
}

Compiler output:
a.cc: In function 'void BabbleSort(int, std::vector<int>)':
a.cc:15:39: error: expected primary-expression before '>' token
   15 |                         if (array[i] => array[j]){
      |                                       ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

//??????????????????
void BabbleSort(int N, vector<int> array){

	int v,count=0;

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

	//?????????????????¨?????????????????°for(i)?????????????????°??????
	for (int k = 0; k < N; k++){
		cout << array[k];
		if (k != N - 1)cout << " ";
	}cout << endl;

	cout << count << endl;



}



int main(){

	int N,Num;
	cin >> N;

	vector<int> array(N, 0);

	for (int i = 0; i < N; i++){
		cin >> Num;
		array[i] = Num;
	}


	BabbleSort(N,array);


	return 0;
}

Compiler output:
a.cc: In function 'void BabbleSort(int, std::vector<int>)':
a.cc:14:38: error: expected primary-expression before '<' token
   14 |                 for (int j = i+1; j =< N; j++){
      |                                      ^
a.cc:15:39: error: expected primary-expression before '>' token
   15 |                         if (array[i] => array[j]){
      |                                       ^
Language: C++

def input_data():
    num = raw_input()
    array = []
    for line in num:
        if line != " ":
            array.append(line)
    return array
def main():
    n = raw_input()
    count = 0
    array = input_data()
    flag = True
    while flag:
        flag = False
        for j in reversed(xrange(1, int(n))):
            if array[j] < array[j - 1]:
                v = array[j]
                array[j] = array[j - 1]
                array[j - 1] = v
                flag = True
                count += 1
    print " ".join(array)
    print str(count)
if __name__ == '__main__':
    main()

Compiler output:
a.cc:24:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   24 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def input_data():
      | ^~~
Language: C++

def input_data():
    num = raw_input()
    array = []
    for line in num:
        if line != " ":
            array.append(line)
    return array


def main():
    n = raw_input()
    count = 0
    array = input_data()
    flag = True
    while flag:
        flag = False
        for j in reversed(xrange(1, int(n))):
            if array[j] < array[j - 1]:
                v = array[j]
                array[j] = array[j - 1]
                array[j - 1] = v
                flag = True
                count += 1
    print " ".join(array)
    print str(count)


if __name__ == '__main__':
    main()

Compiler output:
a.cc:28:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   28 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def input_data():
      | ^~~
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:
a.cc:50:1: error: expected class-name before '~' token
   50 | ~
      | ^
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:
a.cc:49:2: error: expected class-name at end of input
   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:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    4 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>

void bubbleSort(int *,int);

int main(){
	int n;
	cin>>n;
	int *array;
	array=new int [n];
	if (array==NULL) {
		cout<<"Error!"<<endl;
		return -1;
	}
	for (int i=0;i<n;i++){
		cin>>array[i];
	}
	bubbleSort(array,n);
	delete [] array;
	return 0;
}

void bubbleSort(int *a,int n){
	int cnt=0;
	for (int i=0;i<n;i++){
		for (int j=n-1;j>=i+1;j--){
			if (a[j]<a[j-1]){
				int temp;
				temp=a[j];
				a[j]=a[j-1];
				a[j-1]=temp;
				cnt++;
			}
		}
	}
	for (int i=0;i<n;i++){
		cout<<a[i];
		if (i!=n-1){
			cout<<" ";
		}
	}
	cout<<endl;
	cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |                 cout<<"Error!"<<endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |                 cout<<"Error!"<<endl;
      |                                 ^~~~
      |                                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'void bubbleSort(int*, int)':
a.cc:36:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   36 |                 cout<<a[i];
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:41:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   41 |         cout<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:41:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   41 |         cout<<endl;
      |               ^~~~
      |               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>
#include <stdbool.h>

int main(void)
{
	bool flag = true;
	int cnt = 0;
	int n;
	scanf("%d", &n);
	int x[n];
	for(int i = 0; i < n; i++){
		scanf("%d", &x[i]);
	}
	while(flag){
		flag = false;
		for(int i = n - 1; i >= 0; i--){
			if(x[i] > x[i - 1]){
				int temp = x[i];
				x[i] = x[i - 1];
				x[i - 1] = temp;
				cnt++;
				flag = true;
			}
		}
	}
	for(int i = 0; i < n - 1; i++){
		pirntf("%d ", x[i]);
	}
	printf("%d\n%d\n", x[n - 1], cnt);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'pirntf' was not declared in this scope; did you mean 'printf'?
   27 |                 pirntf("%d ", x[i]);
      |                 ^~~~~~
      |                 printf
Language: C++

#include <iostream>

using namespace std;

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

	bool flag = 1;
	int i = 0;

	while(flag) {

		flag = 0;

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

			if(A[j] < A[j-1]) {
				int temp = A[j];
				A[j] = A[j-1];
				A[j-1] = temp;

				flag = 1;
			}
		}
		i++;
	}
	return i;
}

int main(void) {

	int A[100], n, sw;

        cin >> n;
    
    for(int i = 0; i < n; i++) {
        cin >> A[i];
    }

    sw = bubbleSort(A, n);

    for(int i = 0; i < n; i++) {
    	if(i == 0) cout << " ";
    	cout << A[i];
    }
    cout << endl;
    cout << sw << Lendl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:19: error: 'Lendl' was not declared in this scope
   46 |     cout << sw << Lendl;
      |                   ^~~~~
Language: C++

#include <bits/stdc++.h>

int n, r, a[100];

int main()
{
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < i; j++)
		{
			if(a[i] < a[j]) r++;
		}
	}
	
	sort(a, a + n);
	
	for(int i = 0; i < n; i++) { if(i) printf(" "); printf("%d", a[i]); }
	
	printf("\n%d\n", r);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   19 |         sort(a, a + n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<bits/stdc++.h>
int n,r,i,j,a[100];
main(){
scanf("%d",&n);
for(;i<n;)scanf("%d",a+i++);
for(i=0;i<n;i++){
for(j=0;j<i;j++){
if(a[i]<a[j])r++;
}
}
std::sort(a,a+n);
for(i=0;i<n;if(i)printf(" "),printf("%d",a[i++]))
printf("\n%d\n",r);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before 'if'
   12 | for(i=0;i<n;if(i)printf(" "),printf("%d",a[i++]))
      |             ^~
a.cc:12:13: error: expected ')' before 'if'
   12 | for(i=0;i<n;if(i)printf(" "),printf("%d",a[i++]))
      |    ~        ^~
      |             )
a.cc:12:49: error: expected ';' before ')' token
   12 | for(i=0;i<n;if(i)printf(" "),printf("%d",a[i++]))
      |                                                 ^
      |                                                 ;
Language: C++

#include<bits/stdc++.h>
int n,r,i,j,a[100];
main(){
scanf("%d",&n);
for(;i<n;)scanf("%d",a+i++);
for(i=0;i<n;){
for(j=0;j<i;){
if(a[i]<a[j++])r++;
}
}
std::sort(a,a+n);
for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++])}
printf("\n%d\n",r);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '{' token
   12 | for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++])}
      |             ^
a.cc:12:13: error: expected ')' before '{' token
   12 | for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++])}
      |    ~        ^
      |             )
a.cc:12:50: error: expected ';' before '}' token
   12 | for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++])}
      |                                                  ^
      |                                                  ;
Language: C++

#include<bits/stdc++.h>
int n,r,i,j,a[100];
main(){
scanf("%d",&n);
for(;i<n;)scanf("%d",a+i++);
for(i=0;i<n;){
for(j=0;j<i;){
if(a[i]<a[j++])r++;
}
}
std::sort(a,a+n);
for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++]);}
printf("\n%d\n",r);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:13: error: expected primary-expression before '{' token
   12 | for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++]);}
      |             ^
a.cc:12:13: error: expected ')' before '{' token
   12 | for(i=0;i<n;{if(i)printf(" ");printf("%d",a[i++]);}
      |    ~        ^
      |             )
Language: C++

#include<bits/stdc++.h>
#define 
int n,r,i,j,a[100];
main(){
scanf("%d",&n);
for(;i<n;scanf("%d",a+i++))
for(i=0;i<n;i++){
for(j=0;j<i;){
if(a[i]<a[j++])r++;
}
}
std::sort(a,a+n);
for(i=0;i<n;){if(i)printf(" ");printf("%d",a[i++]);}
printf("\n%d\n",r);
}

Compiler output:
a.cc:2:9: error: no macro name given in #define directive
    2 | #define
      |         ^
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
Language: C++


#include<stdio.h>
#define N 100

void swap(int*, int*);
void pr(int*, int);

int main(){
  int n, i, j, k;
  int t=0; // times
  int a[N];

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

  for( i = 0 ; i < n ; i++){
    for(j = n-1 ; j > i ; j--){
      if( a[j] < a[j-1] ){
	swap(&a[j] ,&a[j-1]);
	t++;
      }
    }
  }

  pr(a,n);
  printf("%d\n" ,t);
  return;
}

void swap(int *a_p, int *b_p){
  int k;
  k    = *a_p;
  *a_p = *b_p;
  *b_p = k;
}

void pr(int *a_p, int n){
  int i;
  for( i = 0 ; i < n ; i++ ){
    printf("%d " ,a_p[i]);
  }
  printf("\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
void output(vector<int> a);
int main(void){
	int n;
	int count=0;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	for(int i=0 ; i< n; i++){
		cin >> a[i];
	}
	for(int i=0 ; i < n; i++){
		for(int j=0 ; j < n; j++){
			if (a[i] < a[j]){
				b[j] = a[j];
				a[j] = a[i];
				a[i] = b[j];
			}
		}
		count++;
	}
	output(a);
	cout << count endl;

	return 0;
	
}

void output(vector<int> a){
	for(size_t i=0 ; i< a.size(); i++){
		cout << a[i];
		if( i < a.size()-1){
			cout <<" ";
		}
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before 'endl'
   25 |         cout << count endl;
      |                      ^~~~~
      |                      ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int bubbleSort(A[],N){
int cnt=0,i,j,tmp;
for(i=0;i<n;i++){
for(j=n-i;j>0;j--){
if(A[j]<A[j-1]){
tmp=A[j];
A[j]=A[j-1];
A[j-1]=tmp;
cnt++;
}

}
}
for(i=0;i<n;i++){
if(i>0)cout<<" ";
cout<<A[i];
}
cout<<endl;
cout<<cnt<<endl;
}


int main(){
int N,i;
cin>>N;
int A[N];
for(i=0;i<N;i++)cin>>A[i];
bubbleSort(A,N);
return 0;
}

Compiler output:
a.cc:3:16: error: 'A' was not declared in this scope
    3 | int bubbleSort(A[],N){
      |                ^
a.cc:3:18: error: expected primary-expression before ']' token
    3 | int bubbleSort(A[],N){
      |                  ^
a.cc:3:20: error: 'N' was not declared in this scope
    3 | int bubbleSort(A[],N){
      |                    ^
a.cc:3:21: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | int bubbleSort(A[],N){
      |                     ^
a.cc: In function 'int main()':
a.cc:30:11: error: 'bubbleSort' cannot be used as a function
   30 | bubbleSort(A,N);
      | ~~~~~~~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int bubbleSort(int A[],int N){
int cnt=0,i,j,tmp;
for(i=0;i<n;i++){
for(j=n-i;j>0;j--){
if(A[j]<A[j-1]){
tmp=A[j];
A[j]=A[j-1];
A[j-1]=tmp;
cnt++;
}

}
}
for(i=0;i<n;i++){
if(i>0)cout<<" ";
cout<<A[i];
}
cout<<endl;
cout<<cnt<<endl;
}


int main(){
int N,i;
cin>>N;
int A[N];
for(i=0;i<N;i++)cin>>A[i];
bubbleSort(A,N);
return 0;
}

Compiler output:
a.cc: In function 'int bubbleSort(int*, int)':
a.cc:5:11: error: 'n' was not declared in this scope
    5 | for(i=0;i<n;i++){
      |           ^
a.cc:16:11: error: 'n' was not declared in this scope
   16 | for(i=0;i<n;i++){
      |           ^
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int bubbleSort(int A[],int N){
int cnt=0,i,j,tmp;
for(i=0;i<N;i++){
for(j=N-i;j>0;j--){
if(A[j]<A[j-1]){
tmp=A[j];
A[j]=A[j-1];
A[j-1]=tmp;
cnt++;
}

}
}
for(i=0;i<n;i++){
if(i>0)cout<<" ";
cout<<A[i];
}
cout<<endl;
cout<<cnt<<endl;
}


int main(){
int N,i;
cin>>N;
int A[N];
for(i=0;i<N;i++)cin>>A[i];
bubbleSort(A,N);
return 0;
}

Compiler output:
a.cc: In function 'int bubbleSort(int*, int)':
a.cc:16:11: error: 'n' was not declared in this scope
   16 | for(i=0;i<n;i++){
      |           ^
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

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

void BubbleSort(int A[],int N){
int i,j,tmp,cnt=0;
for(i=0;i<N;i++){
for(j=N-1;j>0;j--){

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

int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++)A[i];
BubbleSort(A,N);
return 0;
}

Compiler output:
a.cc: In function 'void BubbleSort(int*, int)':
a.cc:17:11: error: 'n' was not declared in this scope
   17 | for(i=0;i<n;i++){
      |           ^
Language: C++

#include <stdio.h>
#include <vector>

int main() {
	int n;
	std::vector<int> d;

	scanf_s("%d", &n);

	for (int i = 0; i < n; i++) {
		int b;
		scanf("%d", &b);
		d.push_back(b);
	}
	
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j > i; j--) {
			if (d[j] < d[j - 1]) {
				std::swap(d[j], d[j - 1]);
				cnt++;
			}
		}
	}

	for (auto v = d.begin(); v != d.end(); v++) {
		printf("%d ", *v);
	}
	printf("\n");
	printf("%d\n", cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>
#include <vector>

int main() {
	int n;
	std::vector<int> d;

	scanf_s("%d", &n);

	for (int i = 0; i < n; i++) {
		int b;
		scanf_s("%d", &b);
		d.push_back(b);
	}
	
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j > i; j--) {
			if (d[j] < d[j - 1]) {
				std::swap(d[j], d[j - 1]);
				cnt++;
			}
		}
	}

	for (auto v = d.begin(); v != d.end(); v++) {
		printf("%d%c", *v, (i == d.size() - 1) ? '\n' : ' ');
	}
	printf("%d\n", cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:27:37: error: 'i' was not declared in this scope
   27 |                 printf("%d%c", *v, (i == d.size() - 1) ? '\n' : ' ');
      |                                     ^
Language: C++

#include <stdio.h>
#include <vector>

int main() {
	int n;
	std::vector<int> d;

	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		int b;
		scanf("%d", &b);
		d.push_back(b);
	}
	
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j > i; j--) {
			if (d[j] < d[j - 1]) {
				std::swap(d[j], d[j - 1]);
				cnt++;
			}
		}
	}

	for (auto v = d.begin(); v != d.end(); v++) {
		printf("%d%c", *v, (i == d.size() - 1) ? '\n' : ' ');
	}
	printf("%d\n", cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'i' was not declared in this scope
   27 |                 printf("%d%c", *v, (i == d.size() - 1) ? '\n' : ' ');
      |                                     ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int N;
	cin >> N;
	int A[N];
	for(int i = 0; i < N; ++i){
		cin >> A[i];
	}
	
	int cnt = 0;
	bool flag = true;
	while(flag){
		flag = false;
		for(int j = N - 1; j >= 1; --j){
			if(A[j] < A[j - 1]){
				swap(A[j], A[j - 1]);
				++cnt;
				flag = true;
			}
		}
	}
	for(int i = 0; i < N - 1; ++i) cout << A[i] << " ";
	cout << A[N - 1] << endl;
	cout << cnt << endl;
	
	return 0;
}vvvvvv

Compiler output:
a.cc:30:2: error: 'vvvvvv' does not name a type
   30 | }vvvvvv
      |  ^~~~~~
Language: C++

#include<iostream>
using namespace std;


//--------------------------------------------
void swap(int &A, int &B)
{
	int tmp = A;
	A = B;
	B= tmp;
}
//--------------------------------------------
int bubbleSort(vector<int> &A )
{
	//?????¢??°
	int cnt = 0;
	for(int i = 0; i < (A.length-1), i++){
		for(int j = (A.length-1); j > (i+1 ); j--){
			if(A[j] < A[j-1]){
				swap(A[j], A[j-1]);
				cnt++;
		}
	}
	return cnt;
}
//--------------------------------------------
int main(){
	
	int n;
	cin >> n;
	vector<int> A;
	A.resize(n);
	
	for(int i=0; i<n; i++){
		cin >> A[i] ;
	}
	
	cout << bubbleSort(A)<< endl;

	return 0;
}

Compiler output:
a.cc:13:16: error: 'vector' was not declared in this scope
   13 | int bubbleSort(vector<int> &A )
      |                ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:13:23: error: expected primary-expression before 'int'
   13 | int bubbleSort(vector<int> &A )
      |                       ^~~
Language: C++

#include<cstdio>
int n;
int a[100];
int ans=0;

int ok(){
for(int i=0;i<n-1;i++) if(a[i]>a[i+1]) return i;
return -1;
}

void swap(int i){
int tmp=a[i];
a[i]=a[i+1];
a[i+1]=t;
ans++;
return ;
}

int main(){
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
while(1){
int t=ok();
for(int i=0;i<n-1;i++) if(a[i]>a[i+1]) swap(i);
}
printf("%d?\n",ans);
return 0;
}

Compiler output:
a.cc: In function 'void swap(int)':
a.cc:14:8: error: 't' was not declared in this scope
   14 | a[i+1]=t;
      |        ^
Language: C++

#include <iostream>
#include <stdio>
void swap(int *a, int *b){

  int v = *a;
  
  *a = *b;

  *b = v;
}

int bubblesort(int *A, int N){

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


int main(void){

  int N;
  int i;
  int c;

  while(~scanf("%d",&N)){
    
    int *A = new int[N];
    
    for(i=0;i < N;i++) scanf("%d", &A[i]);
    
    c = bubblesort(A, N);
    
    std::cout << A[0];
    for(i=1;i < N;i++){
      std::cout << " " << A[i]; 
    }
    std::cout << std::endl;
    std::cout << c << std::endl;
    
    delete []A;

  }
  
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: stdio: No such file or directory
    2 | #include <stdio>
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<vecctor>
#include<algorithm>
using namespace std;

void printIntInLine(vector<int> &arr) {
	for(vector<int>::iterator itr=arr.begin(); itr!=???(arr.end()); ++itr) {
		printf(???%d ???, *itr);
	}
	printf(???%d\n???, ???(arr.end()));
}

int main() {
	vector<int> arr:
	int n, tmp, nSwap;

	scanf(???%d???, &n);
	for(int i=0; i<n; ++i) {
		scanf(???%d???, &tmp);
		arr.push_back(tmp);
	}

	nSwap = 0;

	for(vector<int>::iterator itr1=arr.begin(); itr1!=arr.end(); ++itr1) {
		for(vector<int>::iterator itr2=arr.end(); itr2!=itr2; ???itr2) {
			if((*itr2)<(*(itr2-1))) {
				swap(itr2, itr2-1);
				++nSwap;
			}
		}
	}

	printIntInLine(arr);
	printf(???%d\n???, nSwap);
}

Compiler output:
a.cc:2:9: fatal error: vecctor: No such file or directory
    2 | #include<vecctor>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <set>
#include <queue>

#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n;i>0;i--)
#define REP(i,b,n) for(int i=b;i<n;i++)
#define DREP(i,b,n) for(int i=n;i>b;i--)

const float PI = 3.1415926;
static const int INFTY = (1<<30);

using namespace std;

typedef long long ll;
typedef long double ld;

int n, a[100],res;

int main() {
  res = 0;
  cin >> n;
  rep(i,n) cin >> a[i];
  rep(i,n) DREP(j,i,n-1) {
    if(a[j]<a[j-1]) {
      tmp = a[j];
      a[j] = a[j-1];
      a[j-1] = a[j];
      res++;
    }
  }
  rep(i,n)
    cout << a[i];
  cout << endl;
  cout << res << endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:7: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   31 |       tmp = a[j];
      |       ^~~
      |       tm
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
void bubbleSort(int a[], int n, int cnt){
	bool flag = true;
	while(flag){
		flag = false;
		for(int j = n-1; j =1; i--){
			if(a[j-1] > a[j]){
				swap(a[j-1], a[j]);
				cnt++;
				flag = true;
			}
		}
}
int main(){
	int n;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	int cnt = 0;
	bubbleSort(a[n], n, cnt);
	for(int i = 0; i < n; i++){
		if( i != n-1 ) 
			cout << a[i] << " ";
		else            
			cout << a[n-1] << "?\n";
	}
	cout << cnt << "?\n";
}

Compiler output:
a.cc: In function 'void bubbleSort(int*, int, int)':
a.cc:8:40: error: 'i' was not declared in this scope
    8 |                 for(int j = n-1; j =1; i--){
      |                                        ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:41: note: to match this '{'
    4 | void bubbleSort(int a[], int n, int cnt){
      |                                         ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
void bubbleSort(int a[], int n, int cnt){
	bool flag = true;
	while( flag ){
		flag = false;
		for( int j = n-1; j =1; i-- ){
			if(a[ j-1 ] > a[ j ]){
				swap(a[ j-1 ], a[ j ]);
				cnt++;
				flag = true;
			}
		}
}
int main(){
	int n;
	cin >> n;
	int a[ n ];
	for( int i = 0; i < n; i++ ){
		cin >> a[ i ];
	}
	int cnt = 0;
	bubbleSort(a[n], n, cnt);
	for( int i = 0; i < n; i++ ){
		if( i < n-1 ) 
			cout << a[ i ] << " ";
		else            
			cout << a[ i ] << "?\n";
	}
	cout << cnt << "?\n";
}

Compiler output:
a.cc: In function 'void bubbleSort(int*, int, int)':
a.cc:8:41: error: 'i' was not declared in this scope
    8 |                 for( int j = n-1; j =1; i-- ){
      |                                         ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:41: note: to match this '{'
    4 | void bubbleSort(int a[], int n, int cnt){
      |                                         ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
void bubbleSort(int a[], int n, int cnt){
	bool flag = true;
	while( flag ){
		flag = false;
		for( int j = n-1; j =1; i-- ){
			if(a[ j-1 ] > a[ j ]){
				swap(a[ j-1 ], a[ j ]);
				cnt++;
				flag = true;
			}
		}
	}
}
int main(){
	int n;
	cin >> n;
	int a[ n ];
	for( int i = 0; i < n; i++ ){
		cin >> a[ i ];
	}
	int cnt = 0;
	bubbleSort(a[n], n, cnt);
	for( int i = 0; i < n; i++ ){
		if( i < n-1 ) 
			cout << a[ i ] << " ";
		else            
			cout << a[ i ] << "?\n";
	}
	cout << cnt << "?\n";
}

Compiler output:
a.cc: In function 'void bubbleSort(int*, int, int)':
a.cc:8:41: error: 'i' was not declared in this scope
    8 |                 for( int j = n-1; j =1; i-- ){
      |                                         ^
a.cc: In function 'int main()':
a.cc:25:23: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   25 |         bubbleSort(a[n], n, cnt);
      |                    ~~~^
      |                       |
      |                       int
a.cc:4:21: note:   initializing argument 1 of 'void bubbleSort(int*, int, int)'
    4 | void bubbleSort(int a[], int n, int cnt){
      |                 ~~~~^~~