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

#include <stdio.h>
using namespace std;

int insertionSort(int *A, int n, int g, int cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    int cnt = 0;
    int m = (int)(sqrt(n));
    int G[m];
    
    G[0] = n-1;
    for (int i=0; i<m; i++) {
        if(i>0) G[m] = (int)(G[m]/2);
        if(i==m) G[m] = 1;
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", m);
    printf("%d", G[0]);
    for (int i=1; i<m; i++) printf(" %d", G[i]);
    printf("\n");
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:23:19: error: 'sqrt' was not declared in this scope
   23 |     int m = (int)(sqrt(n));
      |                   ^~~~
Language: C++

#include <stdio.h>
using namespace std;

int insertionSort(int *A, int n, int g, int cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    int cnt = 0;
    int m = (int)sqrt(n);
    int G[m];
    
    G[0] = n-1;
    for (int i=0; i<m; i++) {
        if(i>0) G[m] = (int)(G[m]/2);
        if(i==m) G[m] = 1;
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", m);
    printf("%d", G[0]);
    for (int i=1; i<m; i++) printf(" %d", G[i]);
    printf("\n");
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:23:18: error: 'sqrt' was not declared in this scope
   23 |     int m = (int)sqrt(n);
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <math.h>

int insertionSort(int *A, int n, int g, long cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    long cnt = 0;
    int m = (int)sqrt(n);
    int G[m];
    vector<int> G;
    
    for (int h=1; ; ) {
        if (h > n) break;
        G.push_back(h);
        h = 3*h + 1;
    }
    
    // G[0] = (int)(n/3);
    // for (int i=0; i<m; i++) {
    //     if(i>0) G[i] = (int)(G[i-1]/3);
    //     if(i>=m-1) G[i] = 1;
    //     cnt = insertionSort(A, n , G[i], cnt);
    // }
    
    for (int i=G.size()-1; i>=0; i--) {
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", m);
    printf("%d", G[0]);
    for (int i=1; i<m; i++) printf(" %d", G[i]);
    printf("\n");
    printf("%d\n", cnt);
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:25:5: error: 'vector' was not declared in this scope
   25 |     vector<int> G;
      |     ^~~~~~
a.cc:25:12: error: expected primary-expression before 'int'
   25 |     vector<int> G;
      |            ^~~
a.cc:29:11: error: request for member 'push_back' in 'G', which is of non-class type 'int [m]'
   29 |         G.push_back(h);
      |           ^~~~~~~~~
a.cc:40:18: error: request for member 'size' in 'G', which is of non-class type 'int [m]'
   40 |     for (int i=G.size()-1; i>=0; i--) {
      |                  ^~~~
Language: C++

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

int insertionSort(int *A, int n, int g, long cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    long cnt = 0;
    int m = (int)sqrt(n);
    int G[m];
    vector<int> G;
    
    for (int h=1; ; ) {
        if (h > n) break;
        G.push_back(h);
        h = 3*h + 1;
    }
    
    // G[0] = (int)(n/3);
    // for (int i=0; i<m; i++) {
    //     if(i>0) G[i] = (int)(G[i-1]/3);
    //     if(i>=m-1) G[i] = 1;
    //     cnt = insertionSort(A, n , G[i], cnt);
    // }
    
    for (int i=G.size()-1; i>=0; i--) {
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", m);
    printf("%d", G[0]);
    for (int i=1; i<m; i++) printf(" %d", G[i]);
    printf("\n");
    printf("%d\n", cnt);
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:26:5: error: 'vector' was not declared in this scope
   26 |     vector<int> G;
      |     ^~~~~~
a.cc:26:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:26:12: error: expected primary-expression before 'int'
   26 |     vector<int> G;
      |            ^~~
a.cc:30:11: error: request for member 'push_back' in 'G', which is of non-class type 'int [m]'
   30 |         G.push_back(h);
      |           ^~~~~~~~~
a.cc:41:18: error: request for member 'size' in 'G', which is of non-class type 'int [m]'
   41 |     for (int i=G.size()-1; i>=0; i--) {
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <math.h>
#include <vector>
using namespace std;

int insertionSort(int *A, int n, int g, long cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    long cnt = 0;
    int m = (int)sqrt(n);
    int G[m];
    vector<int> G;
    
    for (int h=1; ; ) {
        if (h > n) break;
        G.push_back(h);
        h = 3*h + 1;
    }
    
    // G[0] = (int)(n/3);
    // for (int i=0; i<m; i++) {
    //     if(i>0) G[i] = (int)(G[i-1]/3);
    //     if(i>=m-1) G[i] = 1;
    //     cnt = insertionSort(A, n , G[i], cnt);
    // }
    
    for (int i=G.size()-1; i>=0; i--) {
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", m);
    printf("%d", G[0]);
    for (int i=1; i<m; i++) printf(" %d", G[i]);
    printf("\n");
    printf("%d\n", cnt);
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:27:17: error: conflicting declaration 'std::vector<int> G'
   27 |     vector<int> G;
      |                 ^
a.cc:26:9: note: previous declaration as 'int G [m]'
   26 |     int G[m];
      |         ^
a.cc:31:11: error: request for member 'push_back' in 'G', which is of non-class type 'int [m]'
   31 |         G.push_back(h);
      |           ^~~~~~~~~
a.cc:42:18: error: request for member 'size' in 'G', which is of non-class type 'int [m]'
   42 |     for (int i=G.size()-1; i>=0; i--) {
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <math.h>
#include <vector>
using namespace std;

int insertionSort(int *A, int n, int g, long cnt) {
    for (int i=g; i<n; i++) {
        int v = A[i];
        int j = i - g;
        
        while(j>=0 && A[j]>v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return cnt;
}


void shellSort(int *A, int n) {
    long cnt = 0;
    // int m = (int)sqrt(n);
    // int G[m];
    vector<int> G;
    
    for (int h=1; ; ) {
        if (h > n) break;
        G.push_back(h);
        h = 3*h + 1;
    }
    
    // G[0] = (int)(n/3);
    // for (int i=0; i<m; i++) {
    //     if(i>0) G[i] = (int)(G[i-1]/3);
    //     if(i>=m-1) G[i] = 1;
    //     cnt = insertionSort(A, n , G[i], cnt);
    // }
    
    for (int i=G.size()-1; i>=0; i--) {
        cnt = insertionSort(A, n , G[i], cnt);
    }
    
    printf("%d\n", G.size());
    printf("%d", G[0]);
    for (int i=G.size()-1; i>=0 i--) printf(" %d", G[i]);
    printf("\n");
    printf("%d\n", cnt);
}


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





Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:48:32: error: expected ';' before 'i'
   48 |     for (int i=G.size()-1; i>=0 i--) printf(" %d", G[i]);
      |                                ^~
      |                                ;
Language: C++

//
// Created by yoshihito.hotta on 2018/06/11.
//
#include <iostream>
using namespace std;


int insertionSort(int *A, int n, int g, int cnt) {
    for (int i = g, i < n; i++) {
        int v = A[i];
        int j = i- g;
        while (j >= 0 && A[i] > v) {
            A[j+g] = A[j];
            j = j -g ;
            cnt++;
        }
        A[j+g] = v;
    }
    return cnt;
}

void shellSort(int *A, int n) {
    int cnt = 0;
    int m = 100;
    int g = 1;
    int *G;
    G = new int[m];
    int cnt = 0;
    for (int i = 0; i < m; i++) {
        g = 3 * g + 1;
        G[i] = g;
    }

    for (int i = 0; i < m; i++) {
        cnt = insertionSort(A, n, G[i], cnt);
    }

    cout << m << endl;
    for (int i = 0; i < m; i++) {
        if (i) cout << " ";
        cout << G[i] ;
    }

    cout << cnt << endl;

    for (int j = 0; j < n <; ++j) {
       cout << A[j] << endl;
    }
}

int main() {
    int n;
    int *A;
    cin >> n;
    A = new int [n];

    shellSort(A, n);

    return 0;
}


Compiler output:
a.cc: In function 'int insertionSort(int*, int, int, int)':
a.cc:9:22: error: expected ';' before '<' token
    9 |     for (int i = g, i < n; i++) {
      |                      ^~
      |                      ;
a.cc:9:23: error: expected primary-expression before '<' token
    9 |     for (int i = g, i < n; i++) {
      |                       ^
a.cc: In function 'void shellSort(int*, int)':
a.cc:28:9: error: redeclaration of 'int cnt'
   28 |     int cnt = 0;
      |         ^~~
a.cc:23:9: note: 'int cnt' previously declared here
   23 |     int cnt = 0;
      |         ^~~
a.cc:46:28: error: expected primary-expression before ';' token
   46 |     for (int j = 0; j < n <; ++j) {
      |                            ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void insertionSort(int A[], int n, int g) {
for ( int i = g; i < n; i++ ) {
  int v = A[i];
  int j = i - g;
while( j >= 0 && A[j] > v ) {
  A[j + g] = A[j];
  j -= g;
  cnt++;
}
A[j + g] = v;
}
}
 void shellSort(int A[], int n) {
for ( int h = 1; ; ) {
if ( h > n ) break;
G.push_back(h);
h = 3* + 1;
}

for ( int i = G.size()-1; i >= 0; i-- ) {
insetionSort(A, n, G[i]);
}
}

int main() {
 cin >> n;
for ( int i =0; i < n; i++ ) scanf("%d", &A[i]);
cnt = 0;

shellSort(A, n);

cout << G.size() << endl;
for ( int i = G.size() - 1; i >= 0; i-- ) {
printf("%d", G[i]);
if ( i ) printf(" ");
}
printf("\n");
printf("%d\n", cnt);
for ( int i = 0; i < n; i++ )
printf("%d\n", A[i]);

return 0;
}


Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:34:1: error: 'insetionSort' was not declared in this scope; did you mean 'insertionSort'?
   34 | insetionSort(A, n, G[i]);
      | ^~~~~~~~~~~~
      | insertionSort
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void insertionSort(int A[], int n, int g) {
for ( int i = g; i < n; i++ ) {
  int v = A[i];
  int j = i - g;
while( j >= 0 && A[j] > v ) {
  A[j + g] = A[j];
  j -= g;
  cnt++;
}
A[j + g] = v;
}
}
 void shellSort(int A[], int n) {
for ( int h = 1; ; ) {
if ( h > n ) break;
G.push_back(h);
h = 3*h + 1;
}

for ( int i = G.size()-1; i >= 0; i-- ) {
insetionSort(A, n, G[i]);
}
}

int main() {
 cin >> n;
for ( int i = 0; i < n; i++ ) scanf("%d", &A[i]);
cnt = 0;

shellSort(A, n);

cout << G.size() << endl;
for ( int i = G.size() - 1; i >= 0; i-- ) {
printf("%d", G[i]);
if ( i ) printf(" ");
}
printf("\n");
printf("%d\n", cnt);
for ( int i = 0; i < n; i++ )
printf("%d\n", A[i]);

return 0;
}


Compiler output:
a.cc: In function 'void shellSort(int*, int)':
a.cc:34:1: error: 'insetionSort' was not declared in this scope; did you mean 'insertionSort'?
   34 | insetionSort(A, n, G[i]);
      | ^~~~~~~~~~~~
      | insertionSort
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdin>

using namespace std;

int cnt, m;
int G[100]={1};

void insertionSort(int *A, int n, int g){
  for(int i=g;i<n;i++){
    int v=A[i];
    int j=i-g;

    while(j>=0&&A[j]>v){
      A[j+g]=A[j];
      j-=g;
      cnt++;
    }

    A[j+g]=v;
  }
}

void shellSort(int *A, int n){
  cnt=0;

  for(int i=1;i<100;i++){
    G[i]=3*G[i-1]+1;
    if(G[i]>n){
      m=i;
      break;
    }
  }

  for(int i=0;i<m;i++){
    insertionSort(A, n, G[m-i-1]);
  }
}

int main(){

  int n, a[1000000];

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

  shellSort(a, n);

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

  for(int i=0;i<m;i++){
    printf("%s", (i?" ":""));
    printf("%d", G[m-i-1]);
  }
  printf("\n");

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

  for(int i=0;i<n;i++) printf("%d\n", a[i]);

  return 0;
}



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

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <cstdio>

using namespace std;

long long cnt;
int A[1000000];
int n;
int l;

vector<int> G;

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

void shellSort(int A[], int n){
  for(int h =1; ; ){
    if( h>n ) break;
    G.push_back(h);
    h = 3*h +1;
  }
  for(int i=G.size()-1; i>=0; i--){
    insertionSort(A, n, G[i]);
  }
}

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

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

  shellSort(A, n);

  std::cout << G.size() << std::endl;
  for(int i = G.size()-1; i>=0; i--){
    printf("%d", G[i]);
    if(i) printf(" ");
  }
  printf("\n");
  printf("%d\n", cnt);
  for(int i=0; i<n; i++){
    printf("%d\n", A[i]);
  }
  return 0;
}



Compiler output:
a.cc: In function 'void insertionSort(int*, int, int)':
a.cc:21:13: error: expected ';' before 'A'
   21 |       A[j+g] A[j];
      |             ^~
      |             ;
Language: C++

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

int cnt=0;

int A[1000000];
vector<int> G;
void insertionSort(int A[],int  n, int g){
   int cnt=0;
    for(int i=g;i<n;++i){
        v=a[i];
        j=i-g;
        while(j>=0 && a[j]>v){
            a[j+g]=a[j];
            j-=g;
            cnt++;
        }
        a[j+g]=v;
    }
}
  
  void shellSort(int A[],int n){
      cnt=0;
      int h=1;
      
      while(h<n){
          G.push_back(h);
          h=3*h+1;
      }
      
      for(int i=G.size()-1;i>=0;--i)
        insertionSort(A,n,G[i]);
      
  }
  
  main(){
      int n;
      cin>>n;
      for(int i=0;i<n;++i)cin>>A[i];
      shellSort(A,n);
      cout<<G.size()<<endl;
       for(int i=G.size()-1;i>=0;--i)
        { cout<<G[i];
         if(i)cout<<" ";
        }
        cout<<endl;
        cout<<cnt<<endl;
          for(int i=0;i<n;++i)
          cout<<A[i]<<endl;
  }


Compiler output:
a.cc: In function 'void insertionSort(int*, int, int)':
a.cc:12:9: error: 'v' was not declared in this scope
   12 |         v=a[i];
      |         ^
a.cc:12:11: error: 'a' was not declared in this scope
   12 |         v=a[i];
      |           ^
a.cc:13:9: error: 'j' was not declared in this scope
   13 |         j=i-g;
      |         ^
a.cc: At global scope:
a.cc:37:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   37 |   main(){
      |   ^~~~
Language: C++

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

int cnt=0;

int A[1000000];
vector<int> G;
void insertionSort(int A[],int  n, int g){
   int cnt=0;
   int v;
    for(int i=g;i<n;++i){
        v=a[i];
        j=i-g;
        while(j>=0 && a[j]>v){
            a[j+g]=a[j];
            j-=g;
            cnt++;
        }
        a[j+g]=v;
    }
}
  
  void shellSort(int A[],int n){
      cnt=0;
      int h=1;
      
      while(h<n){
          G.push_back(h);
          h=3*h+1;
      }
      
      for(int i=G.size()-1;i>=0;--i)
        insertionSort(A,n,G[i]);
      
  }
  
  main(){
      int n;
      cin>>n;
      for(int i=0;i<n;++i)cin>>A[i];
      shellSort(A,n);
      cout<<G.size()<<endl;
       for(int i=G.size()-1;i>=0;--i)
        { cout<<G[i];
         if(i)cout<<" ";
        }
        cout<<endl;
        cout<<cnt<<endl;
          for(int i=0;i<n;++i)
          cout<<A[i]<<endl;
  }


Compiler output:
a.cc: In function 'void insertionSort(int*, int, int)':
a.cc:13:11: error: 'a' was not declared in this scope
   13 |         v=a[i];
      |           ^
a.cc:14:9: error: 'j' was not declared in this scope
   14 |         j=i-g;
      |         ^
a.cc: At global scope:
a.cc:38:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   38 |   main(){
      |   ^~~~
Language: C++

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

int cnt=0;

int A[1000000];
vector<int> G;
void insertionSort(int A[],int  n, int g){
   int cnt=0;
   int v;
    for(int i=g;i<n;++i){
        v=A[i];
        j=i-g;
        while(j>=0 && A[j]>v){
            A[j+g]=A[j];
            j-=g;
            cnt++;
        }
        A[j+g]=v;
    }
}
  
  void shellSort(int A[],int n){
      cnt=0;
      int h=1;
      
      while(h<n){
          G.push_back(h);
          h=3*h+1;
      }
      
      for(int i=G.size()-1;i>=0;--i)
        insertionSort(A,n,G[i]);
      
  }
  
  main(){
      int n;
      cin>>n;
      for(int i=0;i<n;++i)cin>>A[i];
      shellSort(A,n);
      cout<<G.size()<<endl;
       for(int i=G.size()-1;i>=0;--i)
        { cout<<G[i];
         if(i)cout<<" ";
        }
        cout<<endl;
        cout<<cnt<<endl;
          for(int i=0;i<n;++i)
          cout<<A[i]<<endl;
  }


Compiler output:
a.cc: In function 'void insertionSort(int*, int, int)':
a.cc:14:9: error: 'j' was not declared in this scope
   14 |         j=i-g;
      |         ^
a.cc: At global scope:
a.cc:38:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   38 |   main(){
      |   ^~~~
Language: C++

#include<iostream>
#include<csdio>
#include<algorythm>
#include<cmath>
#include<vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

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

void shellSort(int A[],int n){
    for(int h = 1; ;){
        if(h>n) break;
        G.push_back(h);
        h = 3*h+1;
    }
    
    for(int i = G.size()-1; i >= 0; i--){
        insertionSort(A,n,G[i]);
        
    }
}

int main(){
    cin >> n;
    for(int i = 0; i<n; i++) scanf("%d",&A[i]);
    cnt = 0;
    
    shellSort(A,n);
    
    cout << G.size() << endl;
    for(int i = G.size()-1;i>=0;i--){
        printf("%d",G[i]);
        if(i) printf(" ");
    }
    printf("\n");
    printf("%d\n",cnt);
    for(int i=0; i<n; i++) printf("%d\n",A[i]);
    return 0;
}


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

#include<iostream>
#include<cstdio>
#include<algorythm>
#include<cmath>
#include<vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

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

void shellSort(int A[],int n){
    for(int h = 1; ;){
        if(h>n) break;
        G.push_back(h);
        h = 3*h+1;
    }
    
    for(int i = G.size()-1; i >= 0; i--){
        insertionSort(A,n,G[i]);
        
    }
}

int main(){
    cin >> n;
    for(int i = 0; i<n; i++) scanf("%d",&A[i]);
    cnt = 0;
    
    shellSort(A,n);
    
    cout << G.size() << endl;
    for(int i = G.size()-1;i>=0;i--){
        printf("%d",G[i]);
        if(i) printf(" ");
    }
    printf("\n");
    printf("%d\n",cnt);
    for(int i=0; i<n; i++) printf("%d\n",A[i]);
    return 0;
}


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

#include <cstdio>
#include <vector>
using namespace std;
int cnt;

void insertionSort(vector<int> &a,int g){
	for(int i=g;i<a.size();i++){
		int v = a[i];
		int j = i - g;
		while(j>=0 && a[j]>v){
			a[j+g] = a[j];
			j = j - g;
			cnt++;
			a[j+g] = v;
		}
	}
}

void shellSort(vector<int> &a){
	vector<int>g;
	cnt = 0;
	for(int h=1;h<a.size();h=3*h+1)g.push_back(h);
	reverse(g.begin(),g.end());
	int m = g.size();
	printf("%d\n",m);
	for(int i=0;i<g.size();i++)printf(i<g.size()-1?"%d ":"%d\n",g[i]);
	for(int i=0;i<m;i++)insertionSort(a,g[i]);
}

int main(){
	vector<int> a;
	int n,x;
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",&x),a.push_back(x);
	shellSort(a);
	printf("%d\n",cnt);
	for(int i=0;i<n;i++)printf("%d\n",a[i]);
}

Compiler output:
a.cc: In function 'void shellSort(std::vector<int>&)':
a.cc:23:9: error: 'reverse' was not declared in this scope
   23 |         reverse(g.begin(),g.end());
      |         ^~~~~~~
Language: Java

import java.util.*;

class Stack<E> {
    E[] arr;
    int top;
    int MAX;

    public Stack(int max) {
        this.MAX = max;
        arr = (E[]) new Object[max];
    }

    void initialize() {
        top = 0;
    }

    boolean isEmpty() {
        return top == 0;
    }

    boolean isFull() {
        return top >= MAX - 1;
    }

    void push(E x) {
        if (isFull()) {
            throw new RuntimeException("オーバーフロー");
        }
        top++;
        arr[this.top] = x;
    }

    E pop() {
        if (isEmpty()) {
            throw new RuntimeException("アンダーフロー");
        }
        top--;
        return arr[this.top + 1];
    }
}

public class ALDS1_3_A {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Stack<Integer> stack = new Stack<>(200);
        stack.initialize();

        while (sc.hasNext()) {
            if (sc.hasNextInt()) {
                stack.push(sc.nextInt());
            } else {
                String s = sc.next();
                int res;
                if (s.equals("+")) {
                    res = stack.pop() + stack.pop();
                } else if (s.equals("-")) {
                    res = - stack.pop() + stack.pop();
                } else if (s.equals("*")) {
                    res = stack.pop() * stack.pop();
                } else {
                    throw new RuntimeException("hoge");
                }
                stack.push(res);
            }
        }

        System.out.println(stack.pop());
    }
}



Compiler output:
Main.java:42: error: class ALDS1_3_A is public, should be declared in a file named ALDS1_3_A.java
public class ALDS1_3_A {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String[] input = scan.nextLine().split(" ");

		Deque<Integer> stack = new ArrayDeque<Integer>();

		for(int i = 0; i < input.length; i++) {
			if(input[i].equals("+") || input[i].equals("-")
					|| input[i].equals("*") || input[i].equals("/")) {
				int b = stack.pop();
				int a = stack.pop();
				switch(input[i]) {
				case "+":
					stack.push(a + b);
					break;
				case "-":
					stack.push(a - b);
					break;
				case "*":
					stack.push(a * b);
					break;
				case "/":
					stack.push(a / b);
					break;
				}

			} else {
				stack.push(Integer.parseInt(input[i]));
			}
		}
		System.out.println(stack.pop());
		scan.close();
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		Deque<Integer> stack = new ArrayDeque<Integer>();
		^
  symbol:   class Deque
  location: class Main
Main.java:7: error: cannot find symbol
		Deque<Integer> stack = new ArrayDeque<Integer>();
		                           ^
  symbol:   class ArrayDeque
  location: class Main
4 errors
Language: Java

import java.util.Scanner;
import java.util.Stack;

public class ReversePolishNotation {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] values = scanner.nextLine().split(" ");
        calcurate(values);
    }

    private static void calcurate(String[] values) {
        Stack<Long> stack = new Stack<>();

        for (int i = 0; i < values.length; i++) {
            switch (values[i]) {
            case "+":
                stack.push(stack.pop() + stack.pop());
                break;
            case "-":
                stack.push(-(stack.pop() - stack.pop()));
                break;
            case "*":
                stack.push(Long.valueOf(stack.pop() * stack.pop()));
                break;
            default:
                stack.push(Long.parseLong(values[i]));
            }
        }

        System.out.println(stack.pop());
    }
}



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

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

class IntStack {
	private int pointer=-1;
	ArrayList<Integer> stack;

	IntStack(){
		stack=new ArrayList();

	}
	public void push(int a){
		stack.add(a);
		pointer++;
	}
	public int pop(){
		int a=stack.get(pointer);
		stack.remove(pointer);
		pointer--;
		return a;
	}
	public String toString(){
		StringBuilder stb=new StringBuilder();
		for(int i:stack)stb.append(i+" ");
		return stb.toString();

	}

}

public class Main103a {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);

		IntStack stack=new IntStack();

		while(sc.hasNext()){
			if(sc.hasNextInt())	stack.push(sc.nextInt());
			else {
				int num=keisan(stack.pop(),stack.pop(),sc.next());
				stack.push(num);
		}
		}System.out.println(stack);

	}
	static int keisan(int num1,int num2,String operator){
		System.out.println(operator);
		switch(operator){
		case "+":num1=num2+num1;break;
		case "-":num1=num2-num1;break;
		case "*":num1=num2*num1;break;
		case "/":num1=num2/num1;break;
		}
		return num1;
	}

}

Compiler output:
Main.java:31: error: class Main103a is public, should be declared in a file named Main103a.java
public class Main103a {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		StackImpl e = new Stack().new StackImpl();
//		while(s.hasNext()) {
			String[] line = s.nextLine().split(" ");
			for(int i=0 ; i<line.length ; i++) {
			if("+".equals(line[i])) {
				int b = e.pop();
				int a = e.pop();
				e.push(a+b);
			} else if("-".equals(line[i])) {
				int b = e.pop();
				int a = e.pop();
				e.push(a-b);
			} else if("*".equals(line[i])) {
				int b = e.pop();
				int a = e.pop();
				e.push(a*b);
			}else {
				e.push(new Integer(line[i]).intValue());
			}
//			}
		}
		System.out.print(e.pop());
	}

	public class StackImpl {

		int[] stack;
		int index;

		public StackImpl() {
			stack = new int[100];
			index = 0;
		}

		public void push(int value) {
			stack[index] = value;
			index++;
		}

		public int pop() {
			index--;
			int returnV = stack[index];
			stack[index] = 0;
			return returnV;
		}
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		StackImpl e = new Stack().new StackImpl();
		                  ^
  symbol:   class Stack
  location: class Main
Main.java:25: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
				e.push(new Integer(line[i]).intValue());
				       ^
1 error
1 warning
Language: Java

class Stack{
	private int[] StackArray;
	private final int maxSize = 100;
	private int top;
	
	public Stack(){
		StackArray = new int[maxSize];
		top = -1;
	}
	public int pop(){
		return StackArray[top--];
	}
	public void push(int o){
		StackArray[++top] = o;
	}
	public int peak(){
		return StackArray[top];
	}
}

public class Main{
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] op = br.readLine().split(" ");
		Stack st = new Stack();
		
		for(int i = 0;i<op.length;i++){
			char ch = op[i].charAt(0);
			int a,b;
			switch(ch){
				case '+':
					a = st.pop();
					b = st.pop();
					st.push(b+a);
					break;
				case '-':
					a = st.pop();
					b = st.pop();
					st.push(b-a);
					break;
				case '*':
					a = st.pop();
					b = st.pop();
					st.push(b*a);
					break;
				case '/':
					a = st.pop();
					b = st.pop();
					st.push(b/a);
					break;
				default:
					st.push(Integer.parseInt(""+ch));
					break;
			}
		}
		System.out.println(st.peak());
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
	public static void main(String[] args)throws IOException {
	                                             ^
  symbol:   class IOException
  location: class Main
Main.java:23: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:23: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:23: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: Java


public class Main {
	public static final String plus = "+";
	public static final String minus = "-";
	public static final String aaa = "*";

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String strInt = null;
		int intStr = 0;
		int numInt1 = 0;
		int numInt2 = 0;
		int total = 0;
		Stack stack = new Stack();
		while(sc.hasNext()){
			strInt = sc.next();
			if(strInt.equals(plus)){
				numInt2 = (int)stack.pop();
				numInt1 = (int)stack.pop();
				total = numInt1 + numInt2;
				stack.push(total);
			}else if(strInt.equals(minus)){
				numInt2 = (int)stack.pop();
				numInt1 = (int)stack.pop();
				total = numInt1 - numInt2;
				stack.push(total);
			}else if(strInt.equalsIgnoreCase(kake)){
				numInt2 = (int)stack.pop();
				numInt1 = (int)stack.pop();
				total = numInt1 * numInt2;
				stack.push(total);
			}else{
				intStr = Integer.parseInt(strInt);
				stack.push(intStr);
			}
		}
		total = (int)stack.pop();
		System.out.println(total);
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
		Stack stack = new Stack();
		^
  symbol:   class Stack
  location: class Main
Main.java:14: error: cannot find symbol
		Stack stack = new Stack();
		                  ^
  symbol:   class Stack
  location: class Main
Main.java:27: error: cannot find symbol
			}else if(strInt.equalsIgnoreCase(kake)){
			                                 ^
  symbol:   variable kake
  location: class Main
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;

class Main {
	public static void main(String args[]) throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		
		
		String str = br.readLine(), str2;
		String[] stA = (str.replaceAll("\\s+", " ")).split(" ", 0);
		
		//str.replaceAll("\\s+", " ") ??§??£?¶???????????????????????????????????????????????????????
		//?¬?????????????????????????????????????split(" ", 0)?????§?????????????????????????????¨??????????????????String???????????????
		
		Stack stack = new Stack();
		
		for(int i = 0; i < stA.length; i++) {
			if(stA[i].equals("+")) {
				//
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b+a));
				
			} else if(stA[i].equals("-")) {
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b-a));
				
			} else if(stA[i].equals("*")) {
				int a = new Integer(stack.pop().toString()).intValue();
				int b = new Integer(stack.pop().toString()).intValue();
				
				stack.push(String.valueOf(b*a));
				
			} else {
				stack.push(stA[i]);
			}
		}
		System.out.println(stack.pop());
	

Compiler output:
Main.java:45: error: reached end of file while parsing
		System.out.println(stack.pop());
		                                ^
1 error
Language: Java


import java.util.Scanner;
import java.util.Stack;

public class Main4 {
	public static void main(String [] args){
		Stack<Integer> stack = new Stack<Integer>();
		Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		String [ ] strings = string.split(" ");
		int size = strings.length;
		int i = 0;
		while( i<size ){
			if("+".equals(strings[i])){
				int a = stack.pop();
				int b = stack.pop();
				int c = a+b;
				stack.push(c);
			}else if("-".equals(strings[i])){
				int a = stack.pop();
				int b = stack.pop();
				int c = b-a;
				stack.push(c);
			}else if("*".equals(strings[i])){
				int a = stack.pop();
				int b = stack.pop();
				int c = b*a;
				stack.push(c);
			}else{
				stack.push(Integer.parseInt(strings[i]));
				
			}
			i++;
		}
		
		System.out.println(stack.pop());
		scanner.close();
	}
}

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

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            String in2 = formula.poll();
            String in1 = formula.poll();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(in1)+Double.parseDouble(in2)));
                    break;
                case "-":
                    formula.push(String.valueOf(Double.parseDouble(in1)-Double.parseDouble(in2)));                    
                    break;
                case "/":
                    formula.push(String.valueOf(Double.parseDouble(in1)/Double.parseDouble(in2)));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(in1)*Double.parseDouble(in2)));
                    break;
                default:
                    formula.push(in1);
                    formula.push(in2);
                    formula.push(input);
                    break;
            }
        }
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:31: error: cannot find symbol
        if(ans==(int)ans){
           ^
  symbol:   variable ans
  location: class Main
Main.java:31: error: cannot find symbol
        if(ans==(int)ans){
                     ^
  symbol:   variable ans
  location: class Main
Main.java:32: error: cannot find symbol
            System.out.println((int)ans);
                                    ^
  symbol:   variable ans
  location: class Main
Main.java:34: error: cannot find symbol
            System.out.println(ans);
                               ^
  symbol:   variable ans
  location: class Main
4 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            String in2 = formula.poll();
            String in1 = formula.poll();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(in1)+Double.parseDouble(in2)));
                    break;
                case "-":
                    formula.push(String.valueOf(Double.parseDouble(in1)-Double.parseDouble(in2)));                    
                    break;
                case "/":
                    formula.push(String.valueOf(Double.parseDouble(in1)/Double.parseDouble(in2)));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(in1)*Double.parseDouble(in2)));
                    break;
                default:
                    formula.push(in1);
                    formula.push(in2);
                    formula.push(input);
                    break;
            }
        }
        if(double ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:31: error: '.class' expected
        if(double ans==(int)ans){
                  ^
Main.java:31: error: not a statement
        if(double ans==(int)ans){
                     ^
Main.java:31: error: ';' expected
        if(double ans==(int)ans){
                               ^
Main.java:33: error: 'else' without 'if'
        }else{
         ^
4 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));
                    break;
                case "-":
                    formula.push(String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));                    
                    break;
                case "/":
                    formula.push(String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                default:
                    formula.push(input);
                    break;
            }
        }
        if((ans=Double.parseDouble(formula.poll())==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:27: error: ')' expected
        if((ans=Double.parseDouble(formula.poll())==(int)ans){
                                                             ^
1 error
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));
                    break;
                case "-":
                    formula.push(String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));                    
                    break;
                case "/":
                    formula.push(String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                default:
                    formula.push(input);
                    break;
            }
        }
        if((Double ans=Double.parseDouble(formula.poll())==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:27: error: ',', ')', or '[' expected
        if((Double ans=Double.parseDouble(formula.poll())==(int)ans){
                      ^
1 error
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));
                    break;
                case "-":
                    formula.push(String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));                    
                    break;
                case "/":
                    formula.push(String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                default:
                    formula.push(input);
                    break;
            }
        }
        if((ans=Double.parseDouble(formula.poll()))==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:27: error: cannot find symbol
        if((ans=Double.parseDouble(formula.poll()))==(int)ans){
            ^
  symbol:   variable ans
  location: class Main
Main.java:27: error: cannot find symbol
        if((ans=Double.parseDouble(formula.poll()))==(int)ans){
                                                          ^
  symbol:   variable ans
  location: class Main
Main.java:28: error: cannot find symbol
            System.out.println((int)ans);
                                    ^
  symbol:   variable ans
  location: class Main
Main.java:30: error: cannot find symbol
            System.out.println(ans);
                               ^
  symbol:   variable ans
  location: class Main
4 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));
                    break;
                case "-":
                    formula.push(String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())));                    
                    break;
                case "/":
                    formula.push(String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                case "*":
                    formula.push(String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())));
                    break;
                default:
                    formula.push(input);
                    break;
            }
        }
        if((Double ans=Double.parseDouble(formula.poll()))==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}

Compiler output:
Main.java:27: error: ',', ')', or '[' expected
        if((Double ans=Double.parseDouble(formula.poll()))==(int)ans){
                      ^
Main.java:27: error: illegal start of expression
        if((Double ans=Double.parseDouble(formula.poll()))==(int)ans){
                                                          ^
Main.java:27: error: ';' expected
        if((Double ans=Double.parseDouble(formula.poll()))==(int)ans){
                                                                    ^
Main.java:29: error: 'else' without 'if'
        }else{
         ^
4 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while((String input=scan.Next())!=NULL){
            switch(input){
                case "+":
                    input = String.valueOf(Integer.ParseInt(formula.poll())+Integer.ParseInt(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Integer.ParseInt(formula.poll())+Integer.ParseInt(formula.poll()));                    
                    break;
                case "*":
                    input = String.valueOf(Integer.ParseInt(formula.poll())*Integer.ParseInt(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        System.out.println(formula.poll());
    }
}

Compiler output:
Main.java:7: error: ',', ')', or '[' expected
        while((String input=scan.Next())!=NULL){
                           ^
Main.java:7: error: illegal start of expression
        while((String input=scan.Next())!=NULL){
                                        ^
Main.java:7: error: ';' expected
        while((String input=scan.Next())!=NULL){
                                              ^
3 errors