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

#include <stdio.h>

static const int N = 100;

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

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

    for (int i = 0; i < N; i++) {
        int key = a[i];
        int j = i - 1;
        while(j > 0 & a[j] > key) {
            a[j+1] = a[j];
            j--;
        }
        a[j+1];
        trace(a, n);
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:29:6: error: expected '}' at end of input
   29 |     }
      |      ^
a.cc:13:12: note: to match this '{'
   13 | int main() {
      |            ^
Language: C++

#include<stdio.h>

static const int N = 1000;

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

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

  for ( i = 1; i <= n; i++ ){
???scanf("%d", &A[i]);
  
  trace(A, n);
  /*

    

   */

  return 0;
}

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

#include <iostream>
#include <vector>

int main()
{
    std::vector<int> array;
    std::vector<int>::iterator it;
    it = array.begin;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: no match for 'operator=' (operand types are 'std::vector<int>::iterator' and '<unresolved overloaded function type>')
    8 |     it = array.begin;
      |                ^~~~~
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:1038:11: note: candidate: 'constexpr __gnu_cxx::__normal_iterator<int*, std::vector<int> >& __gnu_cxx::__normal_iterator<int*, std::vector<int> >::operator=(const __gnu_cxx::__normal_iterator<int*, std::vector<int> >&)'
 1038 |     class __normal_iterator
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1038:11: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >&'
/usr/include/c++/14/bits/stl_iterator.h:1038:11: note: candidate: 'constexpr __gnu_cxx::__normal_iterator<int*, std::vector<int> >& __gnu_cxx::__normal_iterator<int*, std::vector<int> >::operator=(__gnu_cxx::__normal_iterator<int*, std::vector<int> >&&)'
/usr/include/c++/14/bits/stl_iterator.h:1038:11: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >&&'
Language: C++

#include<stdio.h>

static const int N = 1000;

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

void selectionSort(int A[], int n){
  for(int i = 1; i < n; i++){
    int temp = a[i];
    int j = i-1;
    while(j>=0 && temp < A[j]){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = temp;
    trace(A, n);
  }
}

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

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

  return 0;
}

Compiler output:
a.cc: In function 'void selectionSort(int*, int)':
a.cc:16:16: error: 'a' was not declared in this scope
   16 |     int temp = a[i];
      |                ^
Language: C++

#include <iostream>
using namespace std;

vector<int> A;
int N;

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

}
for(int i = 1; i < N-1; i++)
{
  int j = i - 1;
  int key = A[i];
  while( j >= 0 && A[j] > key)
  {
     A[j + 1] = A[j];
     j--;

   }
   A[j + 1] = key;

}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> A;
      | ^~~~~~
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> N;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i = 0; i < N; i++)
      | ^~~
a.cc:8:16: error: 'i' does not name a type
    8 | for(int i = 0; i < N; i++)
      |                ^
a.cc:8:23: error: 'i' does not name a type
    8 | for(int i = 0; i < N; i++)
      |                       ^
a.cc:13:1: error: expected unqualified-id before 'for'
   13 | for(int i = 1; i < N-1; i++)
      | ^~~
a.cc:13:16: error: 'i' does not name a type
   13 | for(int i = 1; i < N-1; i++)
      |                ^
a.cc:13:25: error: 'i' does not name a type
   13 | for(int i = 1; i < N-1; i++)
      |                         ^
Language: C++

#include <iostream>
using namespace std;
 
vector<int> A;
int N;
 
cin >> N;
for(int i = 0; i < N; i++)
{
  cin >> A[i];
 
}
for(int i = 1; i < N-1; i++)
{
  int j = i - 1;
  int key = A[i];
  while( j >= 0 && A[j] > key)
  {
     A[j + 1] = A[j];
     j--;
 
   }
   A[j + 1] = key;
 
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> A;
      | ^~~~~~
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> N;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i = 0; i < N; i++)
      | ^~~
a.cc:8:16: error: 'i' does not name a type
    8 | for(int i = 0; i < N; i++)
      |                ^
a.cc:8:23: error: 'i' does not name a type
    8 | for(int i = 0; i < N; i++)
      |                       ^
a.cc:13:1: error: expected unqualified-id before 'for'
   13 | for(int i = 1; i < N-1; i++)
      | ^~~
a.cc:13:16: error: 'i' does not name a type
   13 | for(int i = 1; i < N-1; i++)
      |                ^
a.cc:13:25: error: 'i' does not name a type
   13 | for(int i = 1; i < N-1; i++)
      |                         ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
vector<int> A;
int N;
 
cin >> N;
for(int i = 0; i < N; i++)
{
  cin >> A[i];
 
}
for(int i = 1; i < N-1; i++)
{
  int j = i - 1;
  int key = A[i];
  while( j >= 0 && A[j] > key)
  {
     A[j + 1] = A[j];
     j--;
 
   }
   A[j + 1] = key;
 
}

Compiler output:
a.cc:8:1: error: 'cin' does not name a type
    8 | cin >> N;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for(int i = 0; i < N; i++)
      | ^~~
a.cc:9:16: error: 'i' does not name a type
    9 | for(int i = 0; i < N; i++)
      |                ^
a.cc:9:23: error: 'i' does not name a type
    9 | for(int i = 0; i < N; i++)
      |                       ^
a.cc:14:1: error: expected unqualified-id before 'for'
   14 | for(int i = 1; i < N-1; i++)
      | ^~~
a.cc:14:16: error: 'i' does not name a type
   14 | for(int i = 1; i < N-1; i++)
      |                ^
a.cc:14:25: error: 'i' does not name a type
   14 | for(int i = 1; i < N-1; i++)
      |                         ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
   
int main(){
  vector<int> A;
  int N;
   
  cin >> N;
  for(int i = 0; i < N; i++)
  {
    cin >> A[i];
   
  }
  for(int i = 1; i < N-1; i++)
  {
    int j = i - 1;
    int key = A[i];
    while( j >= 0 && A[j] > key)
    {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = key;
    for(int i= 0; i< N i++)
    {
      cout << A[i] << " ";
    }
    cout << "" << endl;
    return 0; 
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before 'i'
   25 |     for(int i= 0; i< N i++)
      |                       ^~
      |                       ;
Language: C++

def insertion_sort(array, element_number):
    for i in range(0, element_number):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        for k in range(0, element_number):
            if k < element_number:
                print(array[k] + ' ', end='')
            else:
                print(array[k], end='')

        if i < element_number-1:
            print('\n', end='')

def test():
    element_number = int(input())
    input_array = input().split()

    insertion_sort(input_array, element_number)

if __name__ == '__main__':
    test()

Compiler output:
a.cc:14:43: error: empty character constant
   14 |                 print(array[k] + ' ', end='')
      |                                           ^~
a.cc:16:37: error: empty character constant
   16 |                 print(array[k], end='')
      |                                     ^~
a.cc:19:29: error: empty character constant
   19 |             print('\n', end='')
      |                             ^~
a.cc:27:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   27 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def insertion_sort(array, element_number):
      | ^~~
Language: C++

// InsertionSort.cpp

#include <iostream>

const int ele_Ary = 1000;

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

int main(void) {
	int Num;
	int Ary[ele_Ary];

	cin >> Num;
	for(int i=0; i<Num; i++) cin >> Ary[i];

	insertionSort(Ary, Num);
	for(i=0; i<Num-1; i++) cout << Ary[i] << " ";
	cout << Ary[i] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'void insertionSort(int*, int)':
a.cc:10:24: error: 'j' was not declared in this scope
   10 |                 while( j>=0 && Ary[j] > ver) {
      |                        ^
a.cc:14:17: error: 'A' was not declared in this scope
   14 |                 A[j+1] = ver;
      |                 ^
a.cc:14:19: error: 'j' was not declared in this scope
   14 |                 A[j+1] = ver;
      |                   ^
a.cc: In function 'int main()':
a.cc:22:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   22 |         cin >> Num;
      |         ^~~
      |         std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:13: error: 'i' was not declared in this scope
   26 |         for(i=0; i<Num-1; i++) cout << Ary[i] << " ";
      |             ^
a.cc:26:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |         for(i=0; i<Num-1; i++) cout << Ary[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:27:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |         cout << Ary[i] << 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:27:21: error: 'i' was not declared in this scope
   27 |         cout << Ary[i] << endl;
      |                     ^
a.cc:27:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |         cout << Ary[i] << 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)
      |     ^~~~
Language: C++

// InsertionSort.cpp

#include <iostream>

const int ele_Ary = 1000;

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

int main(void) {
	int Num;
	int Ary[ele_Ary];

	cin >> Num;
	for(int i=0; i<Num; i++) cin >> Ary[i];

	insertionSort(Ary, Num);
	for(i=0; i<Num-1; i++) cout << Ary[i] << " ";
	cout << Ary[i] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'void insertionSort(int*, int)':
a.cc:10:29: error: expected initializer before '>=' token
   10 |                 while( int j>=0 && Ary[j] > ver) {
      |                             ^~
a.cc:10:29: error: expected ')' before '>=' token
   10 |                 while( int j>=0 && Ary[j] > ver) {
      |                      ~      ^~
      |                             )
a.cc:10:29: error: expected primary-expression before '>=' token
   10 |                 while( int j>=0 && Ary[j] > ver) {
      |                             ^~
a.cc:14:17: error: 'A' was not declared in this scope
   14 |                 A[j+1] = ver;
      |                 ^
a.cc:14:19: error: 'j' was not declared in this scope
   14 |                 A[j+1] = ver;
      |                   ^
a.cc: In function 'int main()':
a.cc:22:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   22 |         cin >> Num;
      |         ^~~
      |         std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:13: error: 'i' was not declared in this scope
   26 |         for(i=0; i<Num-1; i++) cout << Ary[i] << " ";
      |             ^
a.cc:26:32: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |         for(i=0; i<Num-1; i++) cout << Ary[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:27:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |         cout << Ary[i] << 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:27:21: error: 'i' was not declared in this scope
   27 |         cout << Ary[i] << endl;
      |                     ^
a.cc:27:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |         cout << Ary[i] << 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)
      |     ^~~~
Language: C++

#include<iostream>
//#include<cstdio>
//#include<cstdlib>
//#pragma warning(disable:4996)

using namespace std;
int main()
{
	//freopen("debug\\input.txt", "r", stdin);
	//freopen("debug\\output.txt", "w", stdout);

	int N = 0;
	cin >> N;  //?????\?????????????´???°???

	int * arry = new int[N];   //??????????????°???????????°???
	
	for (int i = 0; i < N; i++)
	{
		cin >> arry[i];
	}
	//??°????????¨??????

	//insert sort ??§???
	void Insertion_sort(int *, int);
	Insertion_sort(arry, N);
	int tag = 0;
	for (int j = 0; j < N; j++)   //??????????????\
	{
		if (tag)
			cout << " ";
		tag = 1;
		cout << arry[j];
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:30: error: 'j' was not declared in this scope
   32 |                 cout << arry[j];
      |                              ^
a.cc: At global scope:
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return 0;
      |         ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include<iostream>

using namespace std;
int main()
{
        int N = 0;
	cin >> N;  //?????\?????????????´???°???

	int * arry = new int[N];   //??????????????°???????????°???
	
	for (int i = 0; i < N; i++)
	{
		cin >> arry[i];
	}
	//??°????????¨??????

	//insert sort ??§???
	void Insertion_sort(int *, int);
	Insertion_sort(arry, N);
	int tag = 0;
	for (int j = 0; j < N; j++)   //??????????????\
	{
		if (tag)
			cout << " ";
		tag = 1;
		cout << arry[j];
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'j' was not declared in this scope
   26 |                 cout << arry[j];
      |                              ^
a.cc: At global scope:
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

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

#include <stdio.h>
using namespace std;
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 insertSort(int A[], int N) {
	int j, i, v;
	for (i = 1; i < N; i++) {
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		trace(A, N);
	}
}
int main() {
	int N, i, j;
	int A[100];
	scanf_s("%d", &N);
	for (i = 0; i < N; i++)
		scanf_s("%d", &A[i]);
	trace(A, N);
	insertSort(A, N);
	return 0;
}

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

include <iostream>

using namespace std;
static const int MAX=100;

int main () {
  int i, j, p, v, n, A[MAX];

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

  // Insertion Sort
  for (i = 1 ; i < n; i++) {
    v = A[i];
    j = i - 1;
    while (j >= 0 && A[j] > v) {
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;

    // print array
    for (p = 0; p < n; p++) {
      cout << A[p];
      cout << ' ';
    }
    cout << endl;
  }

  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n;
      |   ^~~
a.cc:24:7: error: 'cout' was not declared in this scope
   24 |       cout << A[p];
      |       ^~~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << endl;
      |     ^~~~
a.cc:27:13: error: 'endl' was not declared in this scope
   27 |     cout << endl;
      |             ^~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
void printArray(int a[],int n){
    for(int i=0;i<n;i++){
        cout << a[i];
        cout << " ";
    }
    cout << endl;
}
void insertSort(int a[],int n){
    for(int i=1;i<n-1;i++){
        int v = a[i];
        int j = i - 1;
        while(j>=0 && a[j]>v){
            a[j+1] = a[j];
            j--;
        }
        a[j+1] = v;
        printArray(a,n);
    }
}
int main(){
    int n;
    cin >> n;
    int a[n];
    if(n>=1 && n<=100){
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        printArray(a,n);
        insertSort(a,n);
        printArray(a,n)
    }else{
        return 0;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:24: error: expected ';' before '}' token
   33 |         printArray(a,n)
      |                        ^
      |                        ;
   34 |     }else{
      |     ~
Language: C++

#include<iostream>
using namespace std;

int main() {
	int N; //????´???°
	int A[100]; //??°?????????
	int i, j; //??????????????°

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

	//?¨????
	trace(A, N);
	insertionSort(A, N);

	return 0;
}

//?????????????´???????????????????
void trace(int A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i > 0) { cout << " "; }
		cout << A[i];
	}
	cout << endl;
}

//?????\????????????????????????????????????
void insertionSort(int A[], int N) {
	int j, v;
	for (int i = 1; i < N; i++) {
		v = A[i];
		j = i - 1; //(move)
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		trace(A, N);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'trace' was not declared in this scope
   16 |         trace(A, N);
      |         ^~~~~
a.cc:17:9: error: 'insertionSort' was not declared in this scope
   17 |         insertionSort(A, N);
      |         ^~~~~~~~~~~~~
Language: C++

#include "stdafx.h"
#include <stdio.h>


// ????????????
void trace(int arr[], int size)
{
	int i;
	for (i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}

// ?????\?????????
void insertionSort(int *arr,int size)
{
	for (int i = 1; i < size; i++)
	{
		//printf("%d?????????????????????????±????%d , ??\????????°??????%d??? \n",i,arr[i],i);
		int j = i-1;
		int v = arr[i];
		while (j >= 0 && arr[j]>v)
		{
			arr[j + 1] = arr[j];
			//printf("??°??? %d , " , arr[j]);
			j--;
		}
		arr[j + 1] = v;
		trace(arr, size);
		printf("\n");
	}
}

int main()
{
	int arr[100];
	int N = 0;
	
	/*
	N = 5;
	arr[0] = 8;
	arr[1] = 6;
	arr[2] = 3;
	arr[3] = 9;
	arr[4] = 7;
	*/
	scanf("%d", &N);
	for (int i = 0; i < N; i++)scanf("%d", &arr[i]);

	trace(arr,N);
	insertionSort(arr, N);

	while(true){}
    return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include "stdafx.h"
#include <stdio.h>

void trace(int arr[], int size)
{
	for (int i = 0; i < size; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}

void insertionSort(int *arr,int size)
{
	for (int i = 1; i < size; i++)
	{
		int j = i-1;
		int v = arr[i];
		while (j >= 0 && arr[j]>v)
		{
			arr[j + 1] = arr[j];
			j--;
		}
		arr[j + 1] = v;
		trace(arr, size);
		printf("\n");
	}
}

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

	trace(arr,N);
	insertionSort(arr, N);

    return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>

int main(){

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

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: 'arrayp' was not declared in this scope; did you mean 'array'?
   18 |       else printf("%d",arrayp[k]);
      |                        ^~~~~~
      |                        array
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

for (c = 1 ; c <= n - 1; c++) {
    d = c;
 
    while ( d > 0 && array[d] < array[d-1]) {
      t          = array[d];
      array[d]   = array[d-1];
      array[d-1] = t;
 
      d--;
    }
  }
 
  printf("Sorted list in ascending order:\n");
 
  for (c = 0; c <= n - 1; c++) {
    printf("%d\n", array[c]);
  }

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for (c = 1 ; c <= n - 1; c++) {
      | ^~~
a.cc:1:14: error: 'c' does not name a type
    1 | for (c = 1 ; c <= n - 1; c++) {
      |              ^
a.cc:1:26: error: 'c' does not name a type
    1 | for (c = 1 ; c <= n - 1; c++) {
      |                          ^
a.cc:13:9: error: expected constructor, destructor, or type conversion before '(' token
   13 |   printf("Sorted list in ascending order:\n");
      |         ^
a.cc:15:3: error: expected unqualified-id before 'for'
   15 |   for (c = 0; c <= n - 1; c++) {
      |   ^~~
a.cc:15:15: error: 'c' does not name a type
   15 |   for (c = 0; c <= n - 1; c++) {
      |               ^
a.cc:15:27: error: 'c' does not name a type
   15 |   for (c = 0; c <= n - 1; c++) {
      |                           ^
Language: C++

#include <stdio.h>


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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'else' without a previous 'if'
   16 |   else printf("\n");
      |   ^~~~
a.cc:29:7: error: 'else' without a previous 'if'
   29 |       else printf("\n");
      |       ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

static const int MAX = 100;

void trace(int A[], N){
    int i;
    for (int i = 0; i < N; i++){
        if (i) cout << " ";
        cout << A[i];
    }
    cout << endl;
}

int main(){
    int num;
    int A[MAX];

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

    for (int i = 1; i < num; i++){
        tmp = A[i]
        j = i - 1
        while (j >= 0 && A[j] > v){
            A[j + 1] = A[j]
            j--;
        }
        A[j + 1] = v
        trace(A, num)
    }

    return 0;
}

Compiler output:
a.cc:8:21: error: 'N' has not been declared
    8 | void trace(int A[], N){
      |                     ^
a.cc: In function 'void trace(int*, int)':
a.cc:10:25: error: 'N' was not declared in this scope
   10 |     for (int i = 0; i < N; i++){
      |                         ^
a.cc: In function 'int main()':
a.cc:25:9: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   25 |         tmp = A[i]
      |         ^~~
      |         tm
a.cc:31:11: error: 'j' was not declared in this scope
   31 |         A[j + 1] = v
      |           ^
a.cc:31:20: error: 'v' was not declared in this scope
   31 |         A[j + 1] = v
      |                    ^
Language: C++

#include<iostream>                                        
#include<algorithm>                                       
using namespace std;                                      
                                                          
void insertionSort(int A[],int n){                        
  for(int i=1;i<n;i++){                                   
    int v = A[i];                                         
    int j = i - 1;                                        
    while(j>=0 && A[j] > v){                              
      A[j+1] = A[j];                                      
      j--;                                                
    }                                                     
    A[j+1] = v;                                           
    for(int k=0;k<n;k++){                                 
      if(k>0) cout << " ";                                
      cout << A[k];                                       
    }                                                     
    cout << endl;                                         
  }                                                       
} 
nt main(){                                               
  int A[100];                                             
  int n;                                                  
                                                          
  cin >> n;                                               
                                                          
  for(int i=0;i<n;i++){                                   
    cin >> A[i];                                          
    if(i>0) cout << " ";                                  
    cout << A[i];                                         
  }                                                       
  cout << endl;                                           
                                                          
  insertionSort(A,n);                                     
                                                          
  return 0;                                               
}

Compiler output:
a.cc:21:1: error: 'nt' does not name a type; did you mean 'int'?
   21 | nt main(){
      | ^~
      | int
Language: C++

#include <iostream>
using namespace std;

void ins_sort(int array[], int num){
  for(int i = 1; i < num; i++) {
    int key = array[i];
    int j = i - 1;
    while(j >= 0 && array[j] > key) {
      array[j + 1] = array[j];
      j--;
    }
    array[j+1] = key;
  for(int i = 0; i < num; i++){
 cout << array[i]:
if(i != num - 1) cout << " ";
}
  cout << endl;
  }



}

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

  ins_sort(array, num);
  return 0;
}

Compiler output:
a.cc: In function 'void ins_sort(int*, int)':
a.cc:14:18: error: expected ';' before ':' token
   14 |  cout << array[i]:
      |                  ^
      |                  ;
Language: C++

#include<stdio.h>

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

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

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

  trace(A,N);
  insertionSort(A,N);

  return 0;
}

Compiler output:
a.cc: In function 'void trace(int*, int)':
a.cc:5:10: error: expected ')' before ';' token
    5 |   fot(i=0; i<N; i++){
      |      ~   ^
      |          )
a.cc:5:20: error: expected ';' before ')' token
    5 |   fot(i=0; i<N; i++){
      |                    ^
      |                    ;
Language: C++

//
// Created by Nivras on 2017/5/8.
//

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

const int maxn = 3000;
int num[maxn];

void show(int n) {
    printf("%d", num[0]);
    for (int i = 1; i < n; i++) {
        printf(" %d", num[i]);
    }
    printf("\n");
}

void insertSort(int n) {
    for (int i = 1; i < n; i++) {
        int now = num[i];
        int j = i - 1;
        while (j >= 0 && num[j] > now) {
            num[j+1] = num[j];
            j--;
        }
        num[j+1] = v;
    }
    show(n);
}

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

    insertSort(n);

    return 0;

}

Compiler output:
a.cc: In function 'void insertSort(int)':
a.cc:30:20: error: 'v' was not declared in this scope
   30 |         num[j+1] = v;
      |                    ^
Language: C++

#include<iostream>
using namespace std;
class sort{
private:
  swap(int* a,int* b){
    int temp=*a;
    *a=*b;
    *b=temp;
  }
public:
  sort_insert(int data[],int num){
    
   for(int j=0;j<num;j++){
	cout<<data[j];
	if(j!=num-1)
	  cout<<" ";
      }
      cout<<endl;
    for(int i=1;i<num;i++){
      for(int j=i;j>0;j--){
	if(data[j]<data[j-1])
	  swap(&data[j],&data[j-1]);
      }
      for(int j=0;j<num;j++){
	cout<<data[j];
	if(j!=num-1)
	  cout<<" ";
      }
      cout<<endl;
    }
  }
};

int main(){
  sort Sort;
  int n;
  cin>>n;
  int data[n];
  for(int i=0;i<n;i++)
    cin>>data[i];
  Sort.sort_insert(data,n);
  return 0;
}

Compiler output:
a.cc:5:3: error: ISO C++ forbids declaration of 'swap' with no type [-fpermissive]
    5 |   swap(int* a,int* b){
      |   ^~~~
a.cc:11:3: error: ISO C++ forbids declaration of 'sort_insert' with no type [-fpermissive]
   11 |   sort_insert(int data[],int num){
      |   ^~~~~~~~~~~
a.cc: In member function 'int sort::swap(int*, int*)':
a.cc:9:3: warning: no return statement in function returning non-void [-Wreturn-type]
    9 |   }
      |   ^
a.cc: In member function 'int sort::sort_insert(int*, int)':
a.cc:31:3: warning: no return statement in function returning non-void [-Wreturn-type]
   31 |   }
      |   ^
Language: C++

#include <stdio.h>

#include <iostream>
#include <new>

using namespace std;

void displaySequence(int *values, int N) {
  for (int i = 0; i < N; ++i) {
    cout << values[i]
    if (i < N - 1) cout << ' ';
  }
  cout << endl;
}

void insertionSort(int *values, int N) {
  int index, current;

  for (index = 0; index < N; ++index) {
    int targetValue = values[index];
    for (current = index - 1; current >=0 && values[current] > targetValue; --current) {
      values[current + 1] = values[current];
    }
    values[current + 1] = targetValue;

    // Display intermediate sequence:
    displaySequence(values, N);
  }
}

int main() {
  int N;

  scanf("%d", &N);

  int *values = new int[N];

  for (int i = 0; i < N; ++i) {
      scanf("%d", values + i);
  }

  insertionSort(values, N);

  delete[] values;

  return 0;
}

Compiler output:
a.cc: In function 'void displaySequence(int*, int)':
a.cc:10:22: error: expected ';' before 'if'
   10 |     cout << values[i]
      |                      ^
      |                      ;
   11 |     if (i < N - 1) cout << ' ';
      |     ~~
Language: C++

#include<stdio.h>

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

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

Compiler output:
a.cc:3:20: error: 'N' has not been declared
    3 | void trace(int A[],N){
      |                    ^
a.cc: In function 'void trace(int*, int)':
a.cc:5:20: error: 'N' was not declared in this scope
    5 |         for(i=0; i<N; i++){
      |                    ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:18:19: error: expected ';' before 'trace'
   18 |         A[j+1] = v
      |                   ^
      |                   ;
   19 |         trace(A,N);
      |         ~~~~~
Language: C++

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

	for (int i = 1;i < N; i++) {
		int v = A[i];
		int j = i - 1;

		for (int k = 0;k < N;k++) cout << A[k] << " ";
		cout << endl;

		while (j >= 0 && A[j] > v)
			{
				A[j + 1] = A[j];
				j--;
			}
		A[j + 1] = v;
		
	}
	for (int k = 0;k < N - 1;k++) cout << A[k] << " ";
	cout << A[N - 1];

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N;
      |         ^~~
a.cc:11:43: error: 'cout' was not declared in this scope
   11 |                 for (int k = 0;k < N;k++) cout << A[k] << " ";
      |                                           ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << endl;
      |                 ^~~~
a.cc:12:25: error: 'endl' was not declared in this scope
   12 |                 cout << endl;
      |                         ^~~~
a.cc:22:39: error: 'cout' was not declared in this scope
   22 |         for (int k = 0;k < N - 1;k++) cout << A[k] << " ";
      |                                       ^~~~
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << A[N - 1];
      |         ^~~~
Language: C++

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

#include "stdafx.h"
#include<iostream>
using namespace std;

struct NODE {
	NODE* pNext;
	NODE* pPrevious;
	int Data;
};

struct List {
	NODE* pHead;
	NODE* pTail;
};

NODE* GetNODE(int Data)
{
	NODE* pNode = new NODE;
	if (pNode == NULL)
		return NULL;
	pNode->Data = Data;
	pNode->pNext = NULL;
	pNode->pPrevious = NULL;
	return pNode;
}

List* Initialize(List* &l)
{
	l = new List;
	l->pHead = NULL;
	l->pTail = NULL;
	return l;
}

bool isEmpty(List* l)
{
	return (l->pHead == NULL) ? true : false;
}

List* AddHead(List* &l, int Data)
{
	NODE* pNode = GetNODE(Data);
	if (isEmpty(l))
		l->pHead = l->pTail = pNode;
	else
	{
		pNode->pNext = l->pHead;
		l->pHead->pPrevious = pNode;
		l->pHead = pNode;
	}
	return l;
}

List* AddTail(List* &l, int Data)
{
	NODE* pNode = GetNODE(Data);
	if (isEmpty(l))
		l->pHead = l->pTail = pNode;
	else
	{
		l->pTail->pNext = pNode;
		pNode->pPrevious = l->pTail;
		l->pTail = pNode;
	}
	return l;
}

List* DeleteHead(List* &l)
{
	NODE* pNode = new NODE;
	if (isEmpty(l))
		return NULL;
	else if (l->pHead == l->pTail)
	{
		l->pHead = l->pTail = NULL;
	}
	else
	{
		pNode = l->pHead;
		l->pHead = l->pHead->pNext;
		l->pHead->pPrevious = NULL;
		delete pNode;
	}
	return l;
}

List* DeleteTail(List* &l)
{
	NODE* pNode = new NODE;
	if (isEmpty(l))
	{
		return NULL;
	}
	else if (l->pHead == l->pTail)
		{
			l->pHead = l->pTail = NULL;
		}
		else
		{
			pNode = l->pTail;
			l->pTail = l->pTail->pPrevious;
			l->pTail->pNext = NULL;
			delete pNode;
		}
	return l;
}

List* DeleteNode(List* &l, NODE* pNode)
{
	if (isEmpty(l))
		return NULL;
	else if (l->pHead == l->pTail)
	{
		if (l->pHead == pNode)
			l->pHead = l->pTail = NULL;
		else return NULL;
	}
	else
	{
		pNode->pPrevious->pNext = pNode->pNext;
		pNode->pNext->pPrevious = pNode->pPrevious;
		pNode->pNext = pNode->pPrevious = NULL;
		delete pNode;
	}
	return l;
}

List* List1(List* &l)
{
	char x, y;
	int z;
	cout << "Nhap so hang ";
	int n, i=0;
	cin >> n;
	while (i < n)
	{
		cin >> x;
		cin >> y;
		cin >> z;
		if (x == '+' && y == 'H')
		{
			AddHead(l, z);
		}
		if (x == '+' && y == 'T')
		{
			AddTail(l, z);
		}
		if (x == '-' && y == 'H' && z==0)
		{
			DeleteHead(l);
		}
		if (x == '-' && y == 'T' && z==0)
		{
			DeleteTail(l);
		}
		i++;
	}
	return l;
}

void Output(List* l)
{
	NODE* pNode = l->pHead;
	while (pNode != NULL)
	{
		cout << pNode->Data << " ";
		pNode = pNode->pNext;
	}
}

int main()
{
	List* l;
	Initialize(l);
	List1(l);
	system("pause");
    return 0;
}

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

#include <cstdio>
using namespace std;

void insertionSort(int* a, int n) {
    for (int i = 1; i < n; i++) {
        for (int k = 0; k < n; k++) {
            printf("%d%s", a[k], " ");
        }
        printf("\n");
        int v = a[i];
        int j = i - 1;
        while (j >= 0 && a[j] > v) {
            a[j + 1] = a[j];
            j--;
        }
        a[j + 1] = v;
    }
    for (int k = 0; k < n - 1; k++) {
        printf("%d%s", a[k], " ");
    }
    printf("%d\n", a[n - 1]);
}

int main()
{
    int n;
    scanf_s("%d", &n);
    int* a = new int[n];
    for (int i = 0; i < n; i++) {
        scanf_s("%d", &a[i]);
    }
    insertionSort(a, n);
    delete[] a;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   27 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
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 insertSort(int A[], int N) {
	int value, j, i;
	for (i = 1; i < N - 1; i++) { 
		value = A[i];
		j = i - 1;
		while (j >= 0 && value <  A[j] ) {
			A[j + 1] = A[j];
			j--;
		}

           A[j + 1] = value;
           trace(A, N)
	}

}

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

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

	return 0;
}

Compiler output:
a.cc: In function 'void insertSort(int*, int)':
a.cc:23:23: error: expected ';' before '}' token
   23 |            trace(A, N)
      |                       ^
      |                       ;
   24 |         }
      |         ~
Language: C++


#include <iostream>
#include <conio.h>
using namespace std;

void in(int a[], int n)
{
	cout<<"\n";
	for (int i = 0; i < n; i++)
	{
		cout<<a[i]<<"\t";
	}
}
int main()
{
	int n;
	int key;
	cin>>n;
	int a[100000];
	for (int i = 0; i < n; i++)
		cin>>a[i];
	for (int i = 0; i < n; i++)
	{
		key = a[i];
		/* insert A[i] into the sorted sequence A[0,...,j-1] */
		int j = i - 1;
		while (j >= 0 && a[j] > key)
		{
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = key;
		in(a,n);
	}
	return 0;
}

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

/*
author:lingling
date:2017.06.01
description: ??°??????????????????????¢???????????????\??????
*/
#include<iostream> 
using namespace std;
void InsertSort(int a[],int n);
void PRINT(int a[],int n);
#define MAX 100
int main() {
    int N;
    int data[MAX];
    while(cin>>N) {
        for(int i=0;i<N;i++) cin>>data[i];
        InsertSort(data,N);
    }
    return 0;
}
void InsertSort(int a[],int n) {
    int key;
    int j;
    PRINT(a,n);
    cout<<endl;
    for(int i=1;i<n;i++) {
        key=a[i];//?????????????´?
        j=i-1;
        while(j>=0&&a[j]>key) {
            a[j+1]=a[j];6
            j--;
        }
        a[j+1]=key;
        PRINT(a,n);
        if(i<n-1) cout<<endl;
    }
}
void PRINT(int a[],int n) {
    for(int i=0;i<n;i++) {
        cout<<a[i];
        if(i<n-1) cout<<' ';
    }
 //  cout<<endl;
}

Compiler output:
a.cc: In function 'void InsertSort(int*, int)':
a.cc:29:26: error: expected ';' before 'j'
   29 |             a[j+1]=a[j];6
      |                          ^
      |                          ;
   30 |             j--;
      |             ~
Language: C++

using System;

class ABProblem{
        static void Main(string[] args){
	  string[] str = Console.ReadLine().Split(' ');
	  int a = int.Parse(str[0]);
	  int b = int.Parse(str[1]);
	  int d = a/b;
	  int r = a%b;
	  double f = (double)a/(double)b;
	  Console.WriteLine("{0} {1} {2}",d,r,f);
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:4:26: error: 'string' has not been declared
    4 |         static void Main(string[] args){
      |                          ^~~~~~
a.cc:4:35: error: expected ',' or '...' before 'args'
    4 |         static void Main(string[] args){
      |                                   ^~~~
a.cc:13:2: error: expected ';' after class definition
   13 | }
      |  ^
      |  ;
a.cc: In static member function 'static void ABProblem::Main(int*)':
a.cc:5:11: error: 'string' was not declared in this scope
    5 |           string[] str = Console.ReadLine().Split(' ');
      |           ^~~~~~
a.cc:5:18: error: expected primary-expression before ']' token
    5 |           string[] str = Console.ReadLine().Split(' ');
      |                  ^
a.cc:6:19: error: expected primary-expression before 'int'
    6 |           int a = int.Parse(str[0]);
      |                   ^~~
a.cc:7:19: error: expected primary-expression before 'int'
    7 |           int b = int.Parse(str[1]);
      |                   ^~~
a.cc:11:11: error: 'Console' was not declared in this scope
   11 |           Console.WriteLine("{0} {1} {2}",d,r,f);
      |           ^~~~~~~
Language: C++

#include<stdio.h>

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

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

int main(){
int N,i,j;
intA[100];

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

trace(A,N);
insertionSort(A,N);

return 0;
}

Compiler output:
a.cc: In function 'void trance(int*, int)':
a.cc:5:5: error: expected primary-expression before ')' token
    5 | for()i=0;i<N;i++){
      |     ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:17:15: error: 'a' was not declared in this scope
   17 | while(j>=0 && a[j]>v){
      |               ^
a.cc:22:1: error: 'trace' was not declared in this scope; did you mean 'trance'?
   22 | trace(A,N);
      | ^~~~~
      | trance
a.cc: In function 'int main()':
a.cc:28:1: error: 'intA' was not declared in this scope; did you mean 'int'?
   28 | intA[100];
      | ^~~~
      | int
a.cc:31:29: error: 'A' was not declared in this scope
   31 | for(i=0;i<N;i++)scanf("%d",&A[i]);
      |                             ^
a.cc:33:7: error: 'A' was not declared in this scope
   33 | trace(A,N);
      |       ^
a.cc:33:1: error: 'trace' was not declared in this scope; did you mean 'trance'?
   33 | trace(A,N);
      | ^~~~~
      | trance
Language: C++

#include<iostream>
using namespace std;

int ssort(int A[],int N){
  int i,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj]) minj=j;
    }
    t=A[i]; A[i]=A[minj]; A[minj]=t;
    if(i!=minj) sw++;
  }
  return sw;
}
int main(){
  int i,A[100],N,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++) cin>>A[i];
  sw=ssort(A,N);
  for(i=0;i<N;i++){
    if(i>0) cout<<(" ");
    cout<<A[i];
  }
  cout<<endl;
  cout<<sw<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int ssort(int*, int)':
a.cc:8:9: error: 'j' was not declared in this scope
    8 |     for(j=i;j<N;j++){
      |         ^
Language: C++

#include <iostream>

using namespace std;

int a[100];
int n;

void out(){
    int i;
    cout<<a[1];
    for(i=1;i<n;i++){
        cout<<" "<<a[i];
    }
    cout<<endl;
}

int main()
{
    cin>>n;
    int i;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    out();
    for(i=1;i<n;i++){
        int v=a[i];
        j=i-1;
        while(a[j]>v&&j>=0){
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=v
        out();
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'j' was not declared in this scope
   27 |         j=i-1;
      |         ^
Language: C++

#include<stdio.h>

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

void insert(int R[],int N)
{
	int j,i,v;
	for(i=1;i<N;i++)
	{
		v=R[i];
		j=i-1;
		while(j>=0&& R[j]>v)
		{
			R[j+1]=R[j];
			j--;
   		 }
		R[j+1]=v;
		t(R,N);
	}
}

int main()
{
	int N,i,j;
	int R[100];

	scanf_s("%d",&N);
	for( i=0;i<N;i++)
		scanf("%d",&R[i]);
	t(R,N);
	insert(R,N);
}

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