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

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

void print_vector(vector<int> arr){
    for(int i=0; i<arr.size(); i++){
        cout << arr[i] << " ";
    }
}

void solve(vector<int> arr){
    for(int i=0; i<arr.size(); i++){
        key = arr[i];
        j = i - 1;
        while(j>=0 && arr[j] > key){
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = key;
        print_vector(arr);
    }
    
}

int main(){
    int N;
    vector<int> arr;
    
    int tmp;
    cin >> N;
    while(cin>>tmp){
        arr.push_back(tmp);
    }
    
    
}


Compiler output:
a.cc: In function 'void solve(std::vector<int>)':
a.cc:13:9: error: 'key' was not declared in this scope; did you mean 'key_t'?
   13 |         key = arr[i];
      |         ^~~
      |         key_t
a.cc:14:9: error: 'j' was not declared in this scope
   14 |         j = i - 1;
      |         ^
Language: C++

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

void print_vector(vector<int> arr){
    for(int i=0; i<arr.size(); i++){
        cout << arr[i] << " ";
    }
}

void solve(vector<int> arr){
    int key;
    for(int i=0; i<arr.size(); i++){
        key = arr[i];
        j = i - 1;
        while(j>=0 && arr[j] > key){
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = key;
        print_vector(arr);
    }
    
}

int main(){
    int N;
    vector<int> arr;
    
    int tmp;
    cin >> N;
    while(cin>>tmp){
        arr.push_back(tmp);
    }
    
    
}


Compiler output:
a.cc: In function 'void solve(std::vector<int>)':
a.cc:15:9: error: 'j' was not declared in this scope
   15 |         j = i - 1;
      |         ^
Language: C++

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>

using namespace std;

const int N_MAX = 1000000;

void print_vector(vector<int> arr){
    for(int i=0; i<arr.size(); i++){
        cout << arr[i];
	if(i!=arr.suze()-1) cout << " ";
    }
    cout << endl;
}

void solve(vector<int> arr){
    int key;
    for(int i=0; i<arr.size(); i++){
        key = arr[i];
        int j = i - 1;
        while(j>=0 && arr[j] > key){
            arr[j+1] = arr[j];
            j--;
        }
        arr[j+1] = key;
        print_vector(arr);
    }
}

int main(){
    int N;
    vector<int> arr;    

    cin >> N;
    int x;
    for(int i=0; i<N; i++){
      cin >> x;
      arr.push_back(x);
    }
    solve(arr);
    return 0;
}  



Compiler output:
a.cc: In function 'void print_vector(std::vector<int>)':
a.cc:15:19: error: 'class std::vector<int>' has no member named 'suze'; did you mean 'size'?
   15 |         if(i!=arr.suze()-1) cout << " ";
      |                   ^~~~
      |                   size
Language: C++

# include <stdio.h>

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

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

void insertionSort(A, 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;
        outputArray(A, N)
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'insertionSort' was not declared in this scope
   10 |     insertionSort(a, n);
      |     ^~~~~~~~~~~~~
a.cc: At global scope:
a.cc:13:6: error: variable or field 'outputArray' declared void
   13 | void outputArray(A, N) {
      |      ^~~~~~~~~~~
a.cc:13:18: error: 'A' was not declared in this scope
   13 | void outputArray(A, N) {
      |                  ^
a.cc:13:21: error: 'N' was not declared in this scope
   13 | void outputArray(A, N) {
      |                     ^
a.cc:20:6: error: variable or field 'insertionSort' declared void
   20 | void insertionSort(A, N) {
      |      ^~~~~~~~~~~~~
a.cc:20:20: error: 'A' was not declared in this scope
   20 | void insertionSort(A, N) {
      |                    ^
a.cc:20:23: error: 'N' was not declared in this scope
   20 | void insertionSort(A, N) {
      |                       ^
Language: C++

# include <stdio.h>

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

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

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;
        outputArray(A, N)
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'insertionSort' was not declared in this scope
   10 |     insertionSort(a, n);
      |     ^~~~~~~~~~~~~
a.cc: In function 'void insertionSort(int*, int)':
a.cc:21:16: error: expected ';' before 'i'
   21 |     for(int i=1 i<N; i++) {
      |                ^~
      |                ;
a.cc:29:26: error: expected ';' before '}' token
   29 |         outputArray(A, N)
      |                          ^
      |                          ;
   30 |     }
      |     ~
Language: C++

# include <stdio.h>

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

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

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;
        outputArray(A, N)
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'insertionSort' was not declared in this scope
   10 |     insertionSort(a, n);
      |     ^~~~~~~~~~~~~
a.cc: In function 'void insertionSort(int*, int)':
a.cc:29:26: error: expected ';' before '}' token
   29 |         outputArray(A, N)
      |                          ^
      |                          ;
   30 |     }
      |     ~
Language: C++

# include <stdio.h>

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

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

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;
        outputArray(A, N);
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'insertionSort' was not declared in this scope
   10 |     insertionSort(a, n);
      |     ^~~~~~~~~~~~~
Language: C++

# include <stdio.h>

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

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;
        outputArray(A, N);
    }
}

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



Compiler output:
a.cc: In function 'void outputArray(int*, int)':
a.cc:4:23: error: expected ';' before 'for'
    4 |     printf("%d", A[0])
      |                       ^
      |                       ;
    5 |     for(int i=1; i<N; i++) {
      |     ~~~                
a.cc:5:18: error: 'i' was not declared in this scope
    5 |     for(int i=1; i<N; i++) {
      |                  ^
Language: C++

# include <stdio.h>

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

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;
        outputArray(A, N);
    }
}

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



Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'A' was not declared in this scope
   31 |     outputArray(A, N);
      |                 ^
a.cc:31:20: error: 'N' was not declared in this scope
   31 |     outputArray(A, N);
      |                    ^
Language: C++

#include <iostream>
using namepace std;

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

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


int main(){

  int N;
  int A[100];

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

  insert(A,N);

  print(A,N);
  
  retrun 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepace'
    2 | using namepace std;
      |       ^~~~~~~~
a.cc: In function 'void print(int*, int)':
a.cc:7:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |       cout << " ";
      |       ^~~~
      |       std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout << end;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:13: error: 'end' was not declared in this scope; did you mean 'std::end'?
    9 |     cout << end;
      |             ^~~
      |             std::end
In file included from /usr/include/c++/14/string:53,
                 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:
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:12:27: error: a function-definition is not allowed here before '{' token
   12 | void insert(int A[],int N){
      |                           ^
a.cc:27:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   27 | int main(){
      |         ^~
a.cc:27:9: note: remove parentheses to default-initialize a variable
   27 | int main(){
      |         ^~
      |         --
a.cc:27:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:27:11: error: a function-definition is not allowed here before '{' token
   27 | int main(){
      |           ^
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:4:26: note: to match this '{'
    4 | void print(int A[],int N){
      |                          ^
Language: C++

for i=1to Al.ength-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for i=1to Al.ength-1
      | ^~~
Language: C++

for i=1 to Al.ength-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for i=1 to Al.ength-1
      | ^~~
Language: C++

for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for i=1 to A.length-1
      | ^~~
Language: C++

A[6]={5,2,4,6,1,3}

for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A[6]={5,2,4,6,1,3}
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for i=1 to A.length-1
      | ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,j,z,N;
  int v;
  int *A; 
  scanf("%d",&N);
 
  A = malloc(N * sizeof(int)); 

  for(i=0;i<N;i++){
  scanf("%d",&A[i]);
  }
 
  
  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;
      
      
    }
    for(z=0;z<N;z++){
      printf(" %d ",A[z]);
    }
    printf("\n");
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    9 |   A = malloc(N * sizeof(int));
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

A[6]={5,2,4,6,1,3}
for i=1 to A.length-1
     key=A[i]
     j=i-1
     while j>=0 and A[j]>key
          A[j+1]=A[j]
          j--
     A[j+1]=key
     //for a=0 to
     //printf a[i]


Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A[6]={5,2,4,6,1,3}
      | ^
a.cc:2:1: error: expected unqualified-id before 'for'
    2 | for i=1 to A.length-1
      | ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,j,z,N;
  int v;
  int *A; 
  scanf("%d",&N);
 
  A = malloc(N * sizeof(int)); 

  for(i=0;i<N;i++){
  scanf("%d",&A[i]);
  }
 for(z=0;z<N;z++){
      printf("%d ",A[z]);
    }
    printf("\n");
  
  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;
      
      
    }
    for(z=0;z<N;z++){
      printf("%d ",A[z]);
    }
    printf("\n");
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    9 |   A = malloc(N * sizeof(int));
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include <stdio.h>

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

  for(i=0; i < n; i++){ 
    if(i != 0)printf(" ");
    printf("%d", A[i]);
  }
  printf("/n");
  
  A = insertionSort(&A, n);
  
  for(i=0; i < n; i++){
    if(i != 0)printf(" ");
    printf("%d", A[i]);
  }
  printf("/n");
  
  return 0; 
}

int insertionSort(int* A[], int n){ 
  int i, j, v;
  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(i=0; i < n; i++){ 
      if(i != 0)printf(" "); 
      printf("%d", A[i]);
    }
    printf("/n");
  }
  return A;
}

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

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

/*   for(i=0; i < n; i++){ */
/*     if(i != 0)printf(" "); */
/*     printf("%d", A[i]); */
/*   } */
/*   printf("/n"); */
/* } */



Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: cannot convert 'int (*)[1000]' to 'int*'
   17 |   A = insertionSort(&A, n);
      |                     ^~
      |                     |
      |                     int (*)[1000]
a.cc:3:19: note:   initializing argument 1 of 'int insertionSort(int*, int)'
    3 | int insertionSort(int*, int);
      |                   ^~~~
a.cc: In function 'int insertionSort(int**, int)':
a.cc:31:12: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   31 |     v = A[i];
      |         ~~~^
      |            |
      |            int*
a.cc:33:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |     while(j >= 0 && A[j] > v){
      |                     ~~~~~^~~
a.cc:37:14: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   37 |     A[j+1] = v;
      |              ^
      |              |
      |              int
a.cc:44:10: error: invalid conversion from 'int**' to 'int' [-fpermissive]
   44 |   return A;
      |          ^
      |          |
      |          int**
Language: C++

#include <stdio.h>

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

  for(i=0; i < n; i++){ 
    if(i != 0)printf(" ");
    printf("%d", A[i]);
  }
  printf("/n");
  
  *A = insertionSort(&A, n);
  
  for(i=0; i < n; i++){
    if(i != 0)printf(" ");
    printf("%d", A[i]);
  }
  printf("/n");
  
  return 0; 
}

int insertionSort(int* A[], int n){ 
  int i, j, v;
  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(i=0; i < n; i++){ 
      if(i != 0)printf(" "); 
      printf("%d", A[i]);
    }
    printf("/n");
  }
  return A;
}

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

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

/*   for(i=0; i < n; i++){ */
/*     if(i != 0)printf(" "); */
/*     printf("%d", A[i]); */
/*   } */
/*   printf("/n"); */
/* } */



Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: cannot convert 'int (*)[1000]' to 'int*'
   17 |   *A = insertionSort(&A, n);
      |                      ^~
      |                      |
      |                      int (*)[1000]
a.cc:3:19: note:   initializing argument 1 of 'int insertionSort(int*, int)'
    3 | int insertionSort(int*, int);
      |                   ^~~~
a.cc: In function 'int insertionSort(int**, int)':
a.cc:31:12: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   31 |     v = A[i];
      |         ~~~^
      |            |
      |            int*
a.cc:33:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |     while(j >= 0 && A[j] > v){
      |                     ~~~~~^~~
a.cc:37:14: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   37 |     A[j+1] = v;
      |              ^
      |              |
      |              int
a.cc:44:10: error: invalid conversion from 'int**' to 'int' [-fpermissive]
   44 |   return A;
      |          ^
      |          |
      |          int**
Language: C++

#include <stdio.h>

int main(void)
{
 
  int i, j, tmp, tate, N;
 
  /* 数値を格納する配列 */
  int number[100];
 
  /* 数値の総数を入力 */
  int total;
  scanf("%d", &N);
  scanf("%d",&su);
 
  /* 配列に格納する数値を入力 */
  printf("%d個の数値を入力 \n", total);
  for (i=0; i<total; ++i)
    scanf("%d", &number[i]);
 
  /* 数値を昇順にソート */
  for (i=0; i<total; ++i) {
    for (j=i+1; j<total; ++j) {
      if (number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
 
  /* 昇順ソートした数値を出力 */
  printf("昇順ソートした数値\n");
  for (i=0; i<total; ++i)
    printf("%d\n", number[i]);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: 'su' was not declared in this scope
   14 |   scanf("%d",&su);
      |               ^~
Language: C++

#include <iostream>

int main(){
    int n;
    std::cin >> n;

    int *arr = new int[n];
    int i = 0;
    for(; i < n; ++i){
        std::cin >> arr[i];
    }

    int k;
    for(k = 0; k < n; ++k){
            std::cout << arr[k] << " ";
        }
    std::cout << std::endl;

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

        for(k = 0; k < n; ++k){
            std::cout << arr[k] << ((k == 5)? "" : " ");
        }
        std::cout << ((i < 6)? std::endl : "");
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:44: error: overloaded function with no contextual type information
   31 |         std::cout << ((i < 6)? std::endl : "");
      |                                            ^~
Language: C++

N = int(input())
A = list(map(int, input().split()))

if __name__ == '__main__':
    print(A)
    for i in range(1, N):
        for j in range(N):
            if A[i] < A[j]:
                tmp_num = A[i]
                A[i] = A[j]
                A[j] = tmp_num
        print(A)


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

#include <math.h>
#include <cmath>
using namespace std;
int main()
{
	int n;
	double x[100] = { 0 }, y[100] = { 0 }, p_1 = 0, p_2 = 0, p_3 = 0, p_infinity = -1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) scanf("%lf", &x[i]);
	for (int i = 0; i < n; i++) scanf("%lf", &y[i]);

	for (int i = 0; i < n; i++) {
		p_1 += abs(x[i] - y[i]);
		p_2 += pow(abs(x[i] - y[i]), 2.0);
		p_3 += abs((x[i] - y[i])*(x[i] - y[i])*(x[i] - y[i]));
		p_infinity += (p_infinity >= abs(x[i] - y[i])) ? p_infinity : abs(x[i] - y[i]);
	}
	printf("%.6lf\n",p_1);
	printf("%.6lf\n",sqrt(p_2));
	printf("%.6lf\n", cbrt(p_3));
	printf("%.6lf\n", p_infinity);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%d", &n);
      |         ^~~~~
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("%.6lf\n",p_1);
      |         ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <cmath>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C++

#include<stdio.h>

void tra(int A[],int N);
void insertionSort(int A[],int N);

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

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

  tra(A,N);
  insertionSort(A,N);

  return 0;
}


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

void insertionSort(int A[],int N){
  int j,i,v;
  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;
    tra(A,N);
  }

  
}



Compiler output:
a.cc: In function 'void tra(int*, int)':
a.cc:25:23: error: expected ';' before '}' token
   25 |     if(i<N)printf(" ")
      |                       ^
      |                       ;
   26 |   }
      |   ~
Language: C++

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

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

void InsertionSort(int A[],int N){
  int v,i,j;
  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;
  cin>>N;
  int A[N],i;
  for (int i=0;i<N;i++) cin>>A[i];

  trace(A,N);
  InsertionSort(A,N);

  return 0;
}



Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide<algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'void trace(int*, int)':
a.cc:7:19: error: expected ';' before ')' token
    7 |   for (i=0,i<N,i++){
      |                   ^
      |                   ;
a.cc:11:1: error: expected primary-expression before '}' token
   11 | }
      | ^
a.cc:10:4: error: expected ';' before '}' token
   10 |   }
      |    ^
      |    ;
   11 | }
      | ~   
a.cc:11:1: error: expected primary-expression before '}' token
   11 | }
      | ^
a.cc:10:4: error: expected ')' before '}' token
   10 |   }
      |    ^
      |    )
   11 | }
      | ~   
a.cc:7:7: note: to match this '('
    7 |   for (i=0,i<N,i++){
      |       ^
a.cc:11:1: error: expected primary-expression before '}' token
   11 | }
      | ^
a.cc: In function 'void InsertionSort(int*, int)':
a.cc:15:19: error: expected ';' before ')' token
   15 |   for (i=1,i<N,i++){
      |                   ^
      |                   ;
a.cc:25:3: error: expected primary-expression before '}' token
   25 |   }
      |   ^
a.cc:24:6: error: expected ';' before '}' token
   24 |     }
      |      ^
      |      ;
   25 |   }
      |   ~   
a.cc:25:3: error: expected primary-expression before '}' token
   25 |   }
      |   ^
a.cc:24:6: error: expected ')' before '}' token
   24 |     }
      |      ^
      |      )
   25 |   }
      |   ~   
a.cc:15:7: note: to match this '('
   15 |   for (i=1,i<N,i++){
      |       ^
a.cc:25:3: error: expected primary-expression before '}' token
   25 |   }
      |   ^
a.cc: At global scope:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

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

void trace(int A[],int N){
  int i;
  for (i=0,i<N,i++){
    if (i>0) std::cout << " ";
    std::cout << A[i];
  }
  std::cout << '\n';
}

void InsertionSort(int A[],int N){
  int v,i,j;
  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;
  std::cin>>N;
  int A[N],i;
  for (int i=0;i<N;i++) std::cin>>A[i];

  trace(A,N);
  InsertionSort(A,N);

  return 0;
}



Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide<algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'void trace(int*, int)':
a.cc:7:19: error: expected ';' before ')' token
    7 |   for (i=0,i<N,i++){
      |                   ^
      |                   ;
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc:11:21: error: expected ')' before '}' token
   11 |   std::cout << '\n';
      |                     ^
      |                     )
   12 | }
      | ~                    
a.cc:7:7: note: to match this '('
    7 |   for (i=0,i<N,i++){
      |       ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc: In function 'void InsertionSort(int*, int)':
a.cc:16:19: error: expected ';' before ')' token
   16 |   for (i=1,i<N,i++){
      |                   ^
      |                   ;
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
a.cc:25:6: error: expected ';' before '}' token
   25 |     }
      |      ^
      |      ;
   26 |   }
      |   ~   
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
a.cc:25:6: error: expected ')' before '}' token
   25 |     }
      |      ^
      |      )
   26 |   }
      |   ~   
a.cc:16:7: note: to match this '('
   16 |   for (i=1,i<N,i++){
      |       ^
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
void printArray(int p[],int n){
    for(int i=0;i<n-1;i++)
      cout<<p[i]<<' ';
      cout<<p[n-1]<<endl;
}
void insertionSort(int p[],int n){
    int t;
    for(int i=1;i<n;i++){
        t=p[i];
        for(int j=i-1;j<=0;j--){
            if(p[j]>t)
                p[j+1]=p[j];
            else
                break;
        }
        p[j+1]=t;
      printArray(p,n)   ;
        
    }
   
}
int main(){
    int n;
    cin>>n;
    int *p=new int[n];
    for(int i=0;i<n;i++) cin>>p[i];
    
    insertionSort(p,n);
    
    return 0;
}


Compiler output:
a.cc: In function 'void insertionSort(int*, int)':
a.cc:18:11: error: 'j' was not declared in this scope
   18 |         p[j+1]=t;
      |           ^
Language: C++

#include<iostream>
#include"Header.h"
using namespace std;
int main() {
	int len;
	cin >> len;
	int* arr = new int[len];
	for (int i = 0; i < len; i++)
		cin >> arr[i];
	 for (int i = 0; i < len - 1; i++) {
		printAns(arr, len);
		for (int j = i + 1; j > 0; j--) {
			if (arr[j - 1] > arr[j])
				swap(arr[j - 1], arr[j]);
		}
	}
	printAns(arr, len);

	/*int step = 0;
	for (int i = 0; i < len - 1; i++) {
		for (int j = len - 1; j > i; j--) {
			if (arr[j] < arr[j - 1]) {
				swap(arr[j], arr[j - 1]);
				step++;
			}
		}
	}
	printAns(arr, len);
	cout << step << endl;*/

	/*int step = 0;
	for (int i = 0; i < len - 1 ; i++) {
		if (arr[i] > arr[i + 1]) {
			swap(arr[i], arr[i + 1]);
			step++;
		}
		for(int j=i;j>0;j--){
			if (arr[j] < arr[j - 1]) {
				swap(arr[j], arr[j - 1]);
				step++;
			}
		}
	}
	printAns(arr, len);
	cout << step << endl;*/
	return 0;
}


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

/*Insertion sort*/
#include<stdio.h>


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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected ')' before '{' token
    7 |         while(scanf("%d",&n){
      |              ~              ^
      |                             )
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

void printVector ( vector<int> &v )
{
  for (int i = 0, ilen = v.size(); i < ilen; ++i)
  {
    cout << v[i] << (((i+1) == ilen) ? '\n' : ' ');
  }
}

int main ( void )
{
  int n;
  vector<int> v;

  cin >> n;

  v = vector<int>(n);

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

  for (int i = 0; i < n; ++i)
  {
    for (int j = i-1; (j >= 0) && (v[j] > v[j+1]); --j)
    {
      swap(v[j], v[j+1]);
    }
    pnintVector(v);
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: 'pnintVector' was not declared in this scope; did you mean 'printVector'?
   35 |     pnintVector(v);
      |     ^~~~~~~~~~~
      |     printVector
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef vector <double> DVEC

int Aout(DVEC &A, int n){
	for (int i=0; i<n; i++){
		if (i!=0) cout<<" ";
		cout<<A[i];
	}
	cout<<endl;
	return 0;
}

int insertionsort(DVEC &A, int n){
	double key;
	int i;
	for (int j=1; j<n; j++){
		key = A[j];
		i = j-1;
		while (i>=0){
			if (A[i] <= key) break;
			A[i+1] = A[i];
			i--;
		}
		A[i+1] = key;
		Aout(A, n);
	}
	return 0;
}

int main(void){
	int n;

	cin>>n;
	DVEC A(n);

	for (int i=0; i<n; i++)
		cin>>A[i];
	Aout(A, n);
	insertionsort(A, n);

	return 0;
}

Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int Aout(DVEC &A, int n){
      | ^~~
a.cc:15:19: error: 'DVEC' was not declared in this scope
   15 | int insertionsort(DVEC &A, int n){
      |                   ^~~~
a.cc:15:25: error: 'A' was not declared in this scope
   15 | int insertionsort(DVEC &A, int n){
      |                         ^
a.cc:15:28: error: expected primary-expression before 'int'
   15 | int insertionsort(DVEC &A, int n){
      |                            ^~~
a.cc:15:33: error: expression list treated as compound expression in initializer [-fpermissive]
   15 | int insertionsort(DVEC &A, int n){
      |                                 ^
a.cc: In function 'int main()':
a.cc:36:9: error: 'DVEC' was not declared in this scope
   36 |         DVEC A(n);
      |         ^~~~
a.cc:39:22: error: 'A' was not declared in this scope
   39 |                 cin>>A[i];
      |                      ^
a.cc:40:14: error: 'A' was not declared in this scope
   40 |         Aout(A, n);
      |              ^
a.cc:40:9: error: 'Aout' was not declared in this scope
   40 |         Aout(A, n);
      |         ^~~~
a.cc:41:22: error: 'insertionsort' cannot be used as a function
   41 |         insertionsort(A, n);
      |         ~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef vector <double> DVEC

int Aout(DVEC &A, int n){
	for (int i=0; i<n; i++){
		if (i!=0) cout<<" ";
		cout<<A[i];
	}
	cout<<endl;
	return 0;
}

int insertionsort(DVEC &A, int n){
	double key;
	int i;
	for (int j=1; j<n; j++){
		key = A[j];
		i = j-1;
		while (i>=0){
			if (A[i] <= key) break;
			A[i+1] = A[i];
			i--;
		}
		A[i+1] = key;
		Aout(A, n);
	}
	return 0;
}

int main(void){
	int n;

	cin>>n;
	DVEC A(n);

	for (int i=0; i<n; i++)
		cin>>A[i];
	Aout(A, n);
	insertionsort(A, n);

	return 0;
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int Aout(DVEC &A, int n){
      | ^~~
a.cc:16:19: error: 'DVEC' was not declared in this scope
   16 | int insertionsort(DVEC &A, int n){
      |                   ^~~~
a.cc:16:25: error: 'A' was not declared in this scope
   16 | int insertionsort(DVEC &A, int n){
      |                         ^
a.cc:16:28: error: expected primary-expression before 'int'
   16 | int insertionsort(DVEC &A, int n){
      |                            ^~~
a.cc:16:33: error: expression list treated as compound expression in initializer [-fpermissive]
   16 | int insertionsort(DVEC &A, int n){
      |                                 ^
a.cc: In function 'int main()':
a.cc:37:9: error: 'DVEC' was not declared in this scope
   37 |         DVEC A(n);
      |         ^~~~
a.cc:40:22: error: 'A' was not declared in this scope
   40 |                 cin>>A[i];
      |                      ^
a.cc:41:14: error: 'A' was not declared in this scope
   41 |         Aout(A, n);
      |              ^
a.cc:41:9: error: 'Aout' was not declared in this scope
   41 |         Aout(A, n);
      |         ^~~~
a.cc:42:22: error: 'insertionsort' cannot be used as a function
   42 |         insertionsort(A, n);
      |         ~~~~~~~~~~~~~^~~~~~
Language: C++

int main(){
	int numOfElement;
	int elem[99] = {};

	cin >> numOfElement;

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

	for(int i = 0; i < numOfElement; i++){
		for(int j = 0; j < numOfElement; j++){
			cout << elem[j] << " ";
		}
		cout << endl;
		for(int j = 1; j < numOfElement; j++){
			if(elem[j - 1] > elem[j]){
				int buf = elem[j -1];
				elem[j - 1] = elem[j];
				elem[j] = buf;
				break;
			}
		}

	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> numOfElement;
      |         ^~~
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout << elem[j] << " ";
      |                         ^~~~
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |                 cout << endl;
      |                 ^~~~
a.cc:15:25: error: 'endl' was not declared in this scope
   15 |                 cout << endl;
      |                         ^~~~
Language: C++

#include<iostream>
#include<vector>

int main(){
	int n;
	std::cin >> n;
	std::vector<int> A(n);
	for (int i = 0; i < 6; ++i) std::cin >> A[i];
	for (int i = 1; i < n-1; ++i){
#include<iostream>
#include<vector>

int main(){
	int n;
	std::cin >> n;
	std::vector<int> A(n);
	for (int i = 0; i < 6; ++i) std::cin >> A[i];
	for (int i = 1; i < n-1; ++i){
		for (int k = 0; k < n; ++k){
			if (k != n - 1)std::cout << A[k] << ' ';
			else std::cout << A[k] << std::endl;
		}
		int key = A[i];
		int j = i - 1;
		while (j >= 0 && A[j]>key){
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = key;
	}
	for (int k = 0; k < n; ++k){
		if (k != n - 1)std::cout << A[k] << ' ';
		else std::cout << A[k] << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   13 | int main(){
      |         ^~
a.cc:13:9: note: remove parentheses to default-initialize a variable
   13 | int main(){
      |         ^~
      |         --
a.cc:13:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:13:11: error: a function-definition is not allowed here before '{' token
   13 | int main(){
      |           ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:9:38: note: to match this '{'
    9 |         for (int i = 1; i < n-1; ++i){
      |                                      ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

void insert_sort(int* a, int* b){
    int l = b - a;
    for(y = 0; y < l-1; y++){
        cout << *(a+y) << ' ';
    }
    cout << *(a+l-1) << '\n';
    for(int x = 1; x < l; x++){
        int y = x;
        int i = *(a+x);
        while( y > 0 && *(a+y-1) > i ){
            *(a+y) = *(a+y-1);
            y--;
        }
        *(a+y) = i;
        for(y = 0; y < l-1; y++){
            cout << *(a+y) << ' ';
        }
        cout << *(a+l-1) << '\n';
    }
}

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

Compiler output:
a.cc: In function 'void insert_sort(int*, int*)':
a.cc:6:9: error: 'y' was not declared in this scope
    6 |     for(y = 0; y < l-1; y++){
      |         ^
Language: Java

import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public helper(int a, int b){
       if(a ==0){
         return b;     
       } else {
         return  helper(b % a, a);
       }
    }
}


Compiler output:
Main.java:11: error: invalid method declaration; return type required
    public helper(int a, int b){
           ^
1 error
Language: Java

import java.util.Scanner;
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public int helper(int a, int b){
       if(a ==0){
         return b;     
       } else {
         return  helper(b % a, a);
       }
    }
}


Compiler output:
Main.java:9: error: non-static method helper(int,int) cannot be referenced from a static context
        System.out.println(helper(a,b));
                           ^
1 error
Language: Java

import java.util.Scanner;
# gcd(x, y) = gcd(y, x%y)
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        System.out.println(helper(a,b));
    }
    public static int helper(int a, int b){
       if(b == 0){
         return a;     
       } else {
         return  helper(b, b % a);
       }
    }
}


Compiler output:
Main.java:2: error: illegal character: '#'
# gcd(x, y) = gcd(y, x%y)
^
Main.java:2: error: class, interface, enum, or record expected
# gcd(x, y) = gcd(y, x%y)
     ^
2 errors
Language: Java

import java.util.*;
import java.util.Scanner;

public class Greatest_Common_Divisor {
    public static void main (String args[]) {
        // input

        int a;
        int b;

        Scanner inp = new Scanner(System.in);

        a = inp.nextInt();

        b = inp.nextInt();

       while (b != 0) {
           int temp = a;
           a = b;
           b = temp%b;
       }

       System.out.println(a);
    }
}


Compiler output:
Main.java:4: error: class Greatest_Common_Divisor is public, should be declared in a file named Greatest_Common_Divisor.java
public class Greatest_Common_Divisor {
       ^
1 error
Language: Java


class test {
	public static int solve(int a,int b) {
			 for(int i=(a<=b)?a:b;i>=1;i--){
						if(a%i==0 && b%i==0) return i;
					}
					return 1;
		}
		
	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int a=cin.nextInt(),b=cin.nextInt();
		System.out.println(solve(a,b));
	}
}


Compiler output:
Main.java:11: error: cannot find symbol
		Scanner cin = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class test
Main.java:11: error: cannot find symbol
		Scanner cin = new Scanner(System.in);
		                  ^
  symbol:   class Scanner
  location: class test
2 errors
Language: Java




import java.io.*;
import java.util.*;

public static void main(String args[]) throws Exception
					{
							Scanner cin=new Scanner(System.in);
							int a=cin.nextInt(),b=cin.nextInt();
							 for(int i=(a<=b)?a:b;i>=1;i--){
										if(a%i==0 && b%i==0) System.out.println(i);
									}
							
					}	


Compiler output:
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String args[]) throws Exception
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.io.*;
import java.util.*;
                    public class main(String args[])
                    {
                            Scanner cin=new Scanner(System.in);
                            int a=cin.nextInt(),b=cin.nextInt();
                             for(int i=(a<=b)?a:b;i>=1;i--){
                                        if(a%i==0 && b%i==0) System.out.println(i);
                                    }
                             
                    }


Compiler output:
Main.java:3: error: '{' expected
                    public class main(String args[])
                                     ^
Main.java:7: error: illegal start of type
                             for(int i=(a<=b)?a:b;i>=1;i--){
                             ^
Main.java:7: error: <identifier> expected
                             for(int i=(a<=b)?a:b;i>=1;i--){
                                                   ^
Main.java:7: error: <identifier> expected
                             for(int i=(a<=b)?a:b;i>=1;i--){
                                                        ^
4 errors
Language: Java

	import java.io.*;
	import java.util.*;
					public class Main
					{
								public static void main(String args[]) throws Exception
								{
										Scanner cin=new Scanner(System.in);
										int a=cin.nextInt(),b=cin.nextInt();
										System.out.println(GCD(a,b));
								}
					}
					public int GCD(int a, int b) {
						if (b==0) return a;
						return GCD(b,a%b);
					}


Compiler output:
Main.java:12: error: unnamed classes are a preview feature and are disabled by default.
					public int GCD(int a, int b) {
					       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.io.*;
import java.util.*;
public class test
{
			public static void main(String args[]) throws Exception
			{
					Scanner cin=new Scanner(System.in);
					int a=cin.nextInt(),b=cin.nextInt();
					System.out.println(GCD(a,b));
			}
					public static  int GCD(int a, int b) {
						if (b==0) return a;
						return GCD(b,a%b);
					}
}


Compiler output:
Main.java:3: error: class test is public, should be declared in a file named test.java
public class test
       ^
1 error
Language: Java

import java.util.Scanner;
public class Main() {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(gcd(a,b));
	}
	
	public static int gcd(int x, int y) {
		if (x % y == 0) {
			return y;
		}
		else {
			return gcd(y, x % y);
		}
	}
}



Compiler output:
Main.java:2: error: '{' expected
public class Main() {
                 ^
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            int a = in.nextInt();
            int b = in.nextInt();
            int z = 0;
            for(int i = 1; i <= a; i++) {
            	if(a % i == 0 && b % i == 0) {
            		z = i;
            	}
            }
            System.out.println(z);
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
            Scanner in = new Scanner(System.in);
            ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
            Scanner in = new Scanner(System.in);
                             ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class GreatestCommonDivisor {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int x = in.nextInt();
		int y = in.nextInt();
		int temp = 0;
		if(x == y) System.out.print(x);
		else if(x >= y) {
			while(x % y > 0) {
				temp = x % y;
				x = y;
				y = temp;
			}
			System.out.print(temp);
		}
		else {
			while(y % x > 0) {
				temp = y % x;
				y = x;
				x = temp;
			}
			System.out.print(temp);
		}
	}
}



Compiler output:
Main.java:3: error: class GreatestCommonDivisor is public, should be declared in a file named GreatestCommonDivisor.java
public class GreatestCommonDivisor {
       ^
1 error
Language: Java

import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
int out = helper(x,y);
System.out.println(out);
}

public int helper(int x, int y){
if(y == 0){
return x;
} else if(x >= y){
return helper(y, x%y);
}
}

}


Compiler output:
Main.java:7: error: non-static method helper(int,int) cannot be referenced from a static context
int out = helper(x,y);
          ^
1 error
Language: Java

import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
int out = helper(x,y);
System.out.println(out);
}

public static int helper(int x, int y){
if(y == 0){
return x;
} else if(x >= y){
return helper(y, x%y);
}
}

}


Compiler output:
Main.java:17: error: missing return statement
}
^
1 error
Language: Java

import java.util.Scanner;

public class GreatestCommonDivisor {

    static int gcd(int a, int b)
    {
        if(a == 0 || b == 0) return a+b; // base case
        return gcd(b,a%b);
    }

    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt(), b = sc.nextInt();

        System.out.println(gcd(a,b));


    }
}


Compiler output:
Main.java:3: error: class GreatestCommonDivisor is public, should be declared in a file named GreatestCommonDivisor.java
public class GreatestCommonDivisor {
       ^
1 error