criyle/codenet-compile-errors huggingface dataset:
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();
            if(input.equals("+")) input = String.valueOf(Integer.ParseInt(formula.poll())+Integer.ParseInt(formula.poll()));
            else if(input.equals("-") input = String.valueOf(-1*Integer.ParseInt(formula.poll())+Integer.ParseInt(formula.poll()));
            else if(input.equals("*") input = String.valueOf(Integer.ParseInt(formula.poll())*Integer.ParseInt(formula.poll()));
            formula.push(input);
        }
        System.out.println(formula.poll());
    }
}

Compiler output:
Main.java:10: error: ')' expected
            else if(input.equals("-") input = String.valueOf(-1*Integer.ParseInt(formula.poll())+Integer.ParseInt(formula.poll()));
                                     ^
Main.java:11: error: ')' expected
            else if(input.equals("*") input = String.valueOf(Integer.ParseInt(formula.poll())*Integer.ParseInt(formula.poll()));
                                     ^
2 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();
            if(input.equals("+")) input = String.valueOf(Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));
            else if(input.equals("-") input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));
            else if(input.equals("*") input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));
            formula.push(input);
        }
        System.out.println(formula.poll());
    }
}

Compiler output:
Main.java:10: error: ')' expected
            else if(input.equals("-") input = String.valueOf(-1*Integer.parseInt(formula.poll())+Integer.parseInt(formula.poll()));
                                     ^
Main.java:11: error: ')' expected
            else if(input.equals("*") input = String.valueOf(Integer.parseInt(formula.poll())*Integer.parseInt(formula.poll()));
                                     ^
2 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();
            int num2,num1;

            if(input.equals("+"))
            {
                num2 = Integer.parseInt(formula.poll());
                num1 = Integer.parseInt(formula.poll());
                formula.push(String.valueOf(num1+num2));
            }
            else if(input.equals("*"))
            {
                num2 = Integer.parseInt(formula.poll());
                num1 = Integer.parseInt(formula.poll());
                formula.push(String.valueOf(num1*num2));
            }
            else if(input.equals("="))
            {
                break;
            }
            else
            {
                formula.push(input);
            }
            int size = formula.size();
            for(int i = 0; i<size; i++)
            {
                String p = formula.pollLast();
                System.out.printf("%s ",p);
//                formula.push(p);
            }
            System.out.println();
        }
        System.out.printf(formula.push());
    }
}

Compiler output:
Main.java:45: error: method push in interface Deque<E> cannot be applied to given types;
        System.out.printf(formula.push());
                                 ^
  required: String
  found:    no arguments
  reason: actual and formal argument lists differ in length
  where E is a type-variable:
    E extends Object declared in interface Deque
1 error
Language: Java

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

public class Stack
{
    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();
            int num2,num1;

            if(input.equals("+"))
            {
                num2 = Integer.parseInt(formula.poll());
                num1 = Integer.parseInt(formula.poll());
                formula.push(String.valueOf(num1+num2));
            }
            else if(input.equals("*"))
            {
                num2 = Integer.parseInt(formula.poll());
                num1 = Integer.parseInt(formula.poll());
                formula.push(String.valueOf(num1*num2));
            }
            else if(input.equals("="))
            {
                break;
            }
            else
            {
                formula.push(input);
            }
            int size = formula.size();
            for(int i = 0; i<size; i++)
            {
                String p = formula.pollLast();
                System.out.printf("%s ",p);
//                formula.push(p);
            }
            System.out.println();
        }
        System.out.printf(formula.poll());
    }
}

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

import java.util.*;

public class Test {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		String next;
		int op1, op2;
		Stack<Integer> stack = new Stack<Integer>();

		while(scanner.hasNext()){
			next = scanner.next();
			switch(next){
				case "+":
					op1 = stack.pop();
					op2 = stack.pop();
					stack.push(op2+op1);
					break;
				case "-":
					op1 = stack.pop();
					op2 = stack.pop();
					stack.push(op2-op1);
					break;
				case "*":
					op1 = stack.pop();
					op2 = stack.pop();
					stack.push(op2*op1);
					break;
				default :
					stack.push(Integer.parseInt(next));
			}
		}

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

	}
}

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.*;

import java.lang.Object;





public class stack{	

	public static void main(String[] args) {

		int i,flag,temp;

		char c;

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

		Scanner sc = new Scanner(System.in);

		String str = sc.nextLine();



		flag = 1; temp = 0;

		for(i=0;i<str.length();i++){

			c = str.charAt(i);

			if(c>='0'&&c<='9'){

				if(flag==1){

					stack.push(c-'0');

				}else{

					stack.push(10*stack.pop()+c-'0');

				}

				flag = 1;

			}

			else if(c=='+'){

				stack.push(stack.pop()+stack.pop());

			}

			else if(c=='-'){

				stack.push(-stack.pop()+stack.pop());

			}

			else if(c=='*'){

				stack.push(stack.pop()*stack.pop());

			}

			else{

				flag = 0;

			}

		}

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

	}

}

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

import java.util.*;

import java.lang.Object;





public class postack{	

	public static void main(String[] args) {

		int i,flag,temp;

		char c;

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

		Scanner sc = new Scanner(System.in);

		String str = sc.nextLine();



		flag = 0; temp = 0;

		for(i=0;i<str.length();i++){

			c = str.charAt(i);

			if(c>='0'&&c<='9'){

				if(flag==0){

					stack.push(c-'0');

				}else{

					stack.push(10*stack.pop()+c-'0');

				}

				flag = 1;

			}

			else if(c=='+'){

				stack.push(stack.pop()+stack.pop());

			}

			else if(c=='-'){

				stack.push(-stack.pop()+stack.pop());

			}

			else if(c=='*'){

				stack.push(stack.pop()*stack.pop());

			}

			else{

				flag = 0;

			}

		}

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

	}

}

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

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

/**
 * Created by ??\??? on 2016/12/6.
 */
public class ALDS1_3_A {
    static boolean isNum(String s){
        char[] array = s.toCharArray();
        int flag = 0;
        if(array[0]=='-'&&s.length()>1)
            flag = 1;
        for (char c : array) {
            if(!Character.isDigit(c)){
                flag--;
            }
            if(flag<0)
                return false;
        }
        return true;
    }
    static int si(String s){
        if(isNum(s))
            return Integer.parseInt(s);
        else {
            return -1000000010;
        }
    }
    static int count(String s,String a,String b){
        if(s.equals("+"))
            return si(a)+si(b);
        if(s.equals("-"))
            return si(b)-si(a);
        if(s.equals("*"))
            return si(a)*si(b);
        if(s.equals("/"))
            return si(b)/si(a);
        return -1000000020;
    }
    static int run(String[] args){
        Scanner scan = new Scanner(System.in);
        String[] lines = scan.nextLine().split(" ");
        Stack<String> vs = new Stack<>();
        //Stack<String> os = new Stack<>();
        for (String s:lines) {
            if(isNum(s))
                vs.push(s);
            else{
                String o = s;
                String a = vs.pop();
                String b = vs.pop();
                String c = String.valueOf(count(o,a,b));
                //System.out.println(a+" "+b+" "+c);
                vs.push(c);
            }
        }
        System.out.println(vs.pop());
        return 0;
    }
    public static void main(String[] args){
        run(args);
        //System.out.println(Integer.parseInt("-1"));
    }
}

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

import java.util.Scanner;

public class Main {
	static int[] str = new int[100];
	static int i = 0;
	static void push(int k) {
		if (isFull()==false){
			i++;
			str[i] = k;
		}
		else{
			System.out.print("?????????????????????");
		}
	}
	static int pop() {
		if (isEmpty()==false){
		i--;
		return str[i+1];
	    }
		else{
		String f = "??¢??????????????????";
		int q = Integer.parseInt(f);
			return q;
		}
		}
	static boolean isNumber(String j) {
	    try {
	        Integer.parseInt(j);
	        return true;
	        } catch (NumberFormatException e) {
	        return false;
	    }
	}
	static boolean isEmpty(){
		if (i == 0){
			return true;
		}
		return false;
	}
	static boolean isFull(){
		if (i >= 99){
			return true;
		}
		return false;
	}

	public static void main(String[] args)throws IOException{
		Scanner in = new Scanner(System.in);
		String[] array = in.nextLine().split(" ");
		int size = array.length;
		for (int h=0;h<size;h++){
			if (array[h].equals("+")){
				int b = pop();
				int c = pop();
				int d = c + b;
				push(d);
			}
			else if (array[h].equals("-")){
				int b = pop();
				int c = pop();
				int d = c - b;
				push(d);
			}
			else if (array[h].equals("*")){
				int b = pop();
				int c = pop();
				int d = c * b;
				push(d);
			}
			else
				if (isNumber(array[h])){
				int k = Integer.parseInt(array[h]);
				push(k);
			}
		}
		System.out.print(str[i]);
	}
}

Compiler output:
Main.java:47: error: cannot find symbol
	public static void main(String[] args)throws IOException{
	                                             ^
  symbol:   class IOException
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
 
public class main {
    static StringBuilder builder = new StringBuilder();
 
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));
        final String[] str = reader.readLine().split(" ");
        
        System.out.print(getReversePolishResult(str));
    }
 
    private static int getReversePolishResult(final String str[]){
    	ArrayList<Integer> list = new ArrayList<Integer>();
    	for(int i = 0;i < str.length;++i){
    		final int lastIndex = list.size();
    		switch(str[i].charAt(0)){
    		case '+':{
    			final int num = list.get(lastIndex - 2) + list.get(lastIndex - 1);
    			list.remove(lastIndex - 1);
    			list.remove(lastIndex - 2);
    			list.add(num);
    			break;
    		}
    		case '-':{
    			final int num = list.get(lastIndex - 2) - list.get(lastIndex - 1);
    			list.remove(lastIndex - 1);
    			list.remove(lastIndex - 2);
    			list.add(num);
    			break;
    		}
    		case '*':{
    			final int num = list.get(lastIndex - 2) * list.get(lastIndex - 1);
    			list.remove(lastIndex - 1);
    			list.remove(lastIndex - 2);
    			list.add(num);
    			break;
    		}
    		default:
    			list.add(Integer.parseInt(str[i]));
    			break;
    		}
    	}
    	
    	return list.get(0);
    }
}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in)
								.useDelimiter("[\\s]+");
	private static final MAX = 101;
	private static int[] st = new int[MAX]:
	private int top;

	public static void main(String[] args){

		initialize();
		while(scan.hasNext()){
			String[] cmd = nextLine();
			for(int i = 0; i < cmd.length; i++){
				if(cmd[i].equals("+")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 + n2;
					push(n2);
				}else if(cmd[i].equals("-")){
					int n2 = pop();
					int n3 = pop()
					n2 = n3 - n2;
					push(n2);
				}else if(cmd[i].equals("*")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 * n2;
					push(n2);
				}else{
					int n = Integer.parseInt(cmd[i]);
					push(n);
				}
			}
		}
	}

	public static initialize(){
		top = 0;
	}
	private static boolean isEmpty(){
		return top == 0;
	}
	private static boolean isFull(){
		return top >= MAX - 1;
	}
	public static void push(int x){
		if(isFull())
			System.out.printf("%s\n", "???????????????????????§???");
		top++;
		st[top] = x;
	}
	public static int pop(){
		if(isEmpty())
			System.out.printf("%s\n", "??¢????????????????????§???");
		top--;
		return st[top+1];
	}
}

Compiler output:
Main.java:6: error: <identifier> expected
	private static final MAX = 101;
	                        ^
Main.java:7: error: ';' expected
	private static int[] st = new int[MAX]:
	                                      ^
Main.java:23: error: ';' expected
					int n3 = pop()
					              ^
Main.java:39: error: invalid method declaration; return type required
	public static initialize(){
	              ^
4 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in)
								.useDelimiter("[\\s]+");
	private static final int MAX = 101;
	private static int[] st = new int[MAX];
	private int top;

	public static void main(String[] args){

		initialize();
		while(scan.hasNext()){
			String[] cmd = nextLine();
			for(int i = 0; i < cmd.length; i++){
				if(cmd[i].equals("+")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 + n2;
					push(n2);
				}else if(cmd[i].equals("-")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 - n2;
					push(n2);
				}else if(cmd[i].equals("*")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 * n2;
					push(n2);
				}else{
					int n = Integer.parseInt(cmd[i]);
					push(n);
				}
			}
		}
	}

	public static void initialize(){
		top = 0;
	}
	private static boolean isEmpty(){
		return top == 0;
	}
	private static boolean isFull(){
		return top >= MAX - 1;
	}
	public static void push(int x){
		if(isFull())
			System.out.printf("%s\n", "???????????????????????§???");
		top++;
		st[top] = x;
	}
	public static int pop(){
		if(isEmpty())
			System.out.printf("%s\n", "??¢????????????????????§???");
		top--;
		return st[top+1];
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
			String[] cmd = nextLine();
			               ^
  symbol:   method nextLine()
  location: class Main
Main.java:40: error: non-static variable top cannot be referenced from a static context
		top = 0;
		^
Main.java:43: error: non-static variable top cannot be referenced from a static context
		return top == 0;
		       ^
Main.java:46: error: non-static variable top cannot be referenced from a static context
		return top >= MAX - 1;
		       ^
Main.java:51: error: non-static variable top cannot be referenced from a static context
		top++;
		^
Main.java:52: error: non-static variable top cannot be referenced from a static context
		st[top] = x;
		   ^
Main.java:57: error: non-static variable top cannot be referenced from a static context
		top--;
		^
Main.java:58: error: non-static variable top cannot be referenced from a static context
		return st[top+1];
		          ^
8 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in)
								.useDelimiter("[\\s]+");
	private static final int MAX = 101;
	private static int[] st = new int[MAX];
	private static int top;

	public static void main(String[] args){

		initialize();
		while(scan.hasNext()){
			String[] cmd = scan.nextLine();
			for(int i = 0; i < cmd.length; i++){
				if(cmd[i].equals("+")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 + n2;
					push(n2);
				}else if(cmd[i].equals("-")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 - n2;
					push(n2);
				}else if(cmd[i].equals("*")){
					int n2 = pop();
					int n3 = pop();
					n2 = n3 * n2;
					push(n2);
				}else{
					int n = Integer.parseInt(cmd[i]);
					push(n);
				}
			}
		}
	}

	public static void initialize(){
		top = 0;
	}
	private static boolean isEmpty(){
		return top == 0;
	}
	private static boolean isFull(){
		return top >= MAX - 1;
	}
	public static void push(int x){
		if(isFull())
			System.out.printf("%s\n", "???????????????????????§???");
		top++;
		st[top] = x;
	}
	public static int pop(){
		if(isEmpty())
			System.out.printf("%s\n", "??¢????????????????????§???");
		top--;
		return st[top+1];
	}
}

Compiler output:
Main.java:14: error: incompatible types: String cannot be converted to String[]
			String[] cmd = scan.nextLine();
			                            ^
1 error
Language: Java

import java.util.Scanner;
class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		
		Stack<Integer> stack = new Stack<Integer>();
		int x = 0;
		int y = 0;
		int tmp = 0;
		
		for(int i = 0; i < str.length(); i++){
			switch(str.charAt(i))
			{
				case '+':
					x = stack.pop();
					y = stack.pop();
					stack.add(y + x);
					break;
				case '-':
					x = stack.pop();
					y = stack.pop();
					stack.add(y - x);
					break;
				case '*':
					x = stack.pop();
					y = stack.pop();
					stack.add(y * x);
					break;
				case '/':
					x = stack.pop();
					y = stack.pop();
					stack.add(y / x);
					break;
				case ' ':
					break;
				default:
					tmp = str.charAt(i) - '0';
					stack.push(tmp);
			}
		}
		System.out.println(stack.pop());
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		Stack<Integer> stack = new Stack<Integer>();
		^
  symbol:   class Stack
  location: class Main
Main.java:7: error: cannot find symbol
		Stack<Integer> stack = new Stack<Integer>();
		                           ^
  symbol:   class Stack
  location: class Main
2 errors
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] all = line.split(" ");
		
		ArrayList<Integer> allint = new ArrayList<Integer>();
		
		for (int i = 0; i < all.length; i++) {
			if (judge(all[i]) == true) {
				allint.add(Integer.parseInt(all[i]));
			} else if (all[i].equals("+")) {
				if (allint.size() == 3) {
					allint.set(1, allint.get(1) + allint.get(2));
					allint.remove(2);
				} else {
					allint.set(0, allint.get(0) + allint.get(1));
					allint.remove(1);
				}

			} else if (all[i].equals("-")) {
				if (allint.size() == 3) {
					allint.set(1, allint.get(1) - allint.get(2));
					allint.remove(2);
				} else {
					allint.set(0, allint.get(0) - allint.get(1));
					allint.remove(1);
				}

			} else if (all[i].equals("*")) {
				if (allint.size() == 3) {
					allint.set(1, allint.get(1) * allint.get(2));
					allint.remove(2);
				} else {
					allint.set(0, allint.get(0) * allint.get(1));
					allint.remove(1);
				}

			}
			
		}
		
		System.out.println(allint.get(0));
		
		
	}

	String n;
	
	public Test03_1(String n) {
		super();
		this.n = n;
	}

	public static boolean judge(String n) {
		try {
			Integer.parseInt(n);
			return true;
		} catch (NumberFormatException e) {
			return false;
		}

	}
}

Compiler output:
Main.java:54: error: invalid method declaration; return type required
	public Test03_1(String n) {
	       ^
1 error
Language: Java

import java.util.Scanner;

public class Stack {
  static int top = 0;
  static int[] S = new int[101];
  
  static void push(int x) {
    S[++top] = x;
  }

  static int pop() {
    top--;
    return S[top + 1];
  }
  
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    String s;
    int a, b;
    while (stdIn.hasNext()) {
      s = stdIn.next();
      if (s.equals("+")) {
        a = pop();
        b = pop();
        push(a + b);
      } else if (s.equals("-")) {
        b = pop();
        a = pop();
        push(a - b);
      } else if (s.equals("*")) {
        a = pop();
        b = pop();
        push(a * b);
      } else {
        push(Integer.parseInt(s));
      }
    }

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

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


import java.util.Scanner;

class Main{
  int[] a = new int[200];
  int top;

  Stack(){
    top = 0;
  }

  void push(int x){
    a[++top] = x;
  }

  int pop(){
    return a[top--];
  }

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

    Stack stack = new Stack();


    while(stdIn.hasNext()){
      String input = stdIn.next();

      if(input.equals("+")){
        int a = stack.pop();
        int b = stack.pop();
        stack.push(a + b);
      }
      else if(input.equals("*")){
        int a = stack.pop();
        int b = stack.pop();
        stack.push(a * b);
      }
      else if(input.equals("-")){
        int b = stack.pop();
        int a = stack.pop();
        stack.push(a-b);
      }
      else
        stack.push(Integer.parseInt(input));

    }


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

Compiler output:
Main.java:8: error: invalid method declaration; return type required
  Stack(){
  ^
1 error
Language: Java


import java.util.Scanner;

class Main{
  int[] a = new int[200];
  int top;

  Stack(){
    top = 0;
  }

  void push(int x){
    a[++top] = x;
  }

  int pop(){
    return a[top--];
  }

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

    Main stack = new Main();


    while(stdIn.hasNext()){
      String input = stdIn.next();

      if(input.equals("+")){
        int a = stack.pop();
        int b = stack.pop();
        stack.push(a + b);
      }
      else if(input.equals("*")){
        int a = stack.pop();
        int b = stack.pop();
        stack.push(a * b);
      }
      else if(input.equals("-")){
        int b = stack.pop();
        int a = stack.pop();
        stack.push(a-b);
      }
      else
        stack.push(Integer.parseInt(input));

    }


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

Compiler output:
Main.java:8: error: invalid method declaration; return type required
  Stack(){
  ^
1 error
Language: Java

package javaTest;

import org.apache.commons.lang.StringUtils;

import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created by Lenovo on 2017/6/30.
 */
public class Algorithm {
    public static void main(String[] args){
//        int n = 7;
//        int list[] = {5,3,1,3,4,2,6};
//        int result = getMax(n,list);
//        System.out.println(result);
        Scanner scanner = new Scanner(System.in);
        String[] expr = scanner.nextLine().split(" ");
        LinkedList<Integer> stack = new LinkedList<>();
        for(String str : expr){
            if(str.equals("+") ||str.equals("-") || str.equals("*")){
                int temp,num1 = stack.pop(),num2 = stack.pop();
                switch (str){
                    case "+": temp = num1+num2;
                        break;
                    case "-": temp = num2 - num1;
                        break;
                    default:temp = num1*num2;
                        break;
                }
                stack.push(temp);
            }else{
                stack.push(Integer.valueOf(str));
            }
        }
        System.out.println(stack.pop());
        
    }

//    private static int getMax(int n, int[] list) {
//        int max = Integer.MIN_VALUE, left = 0;
//
//        for(int i = 1; i < n; i++){
//            System.out.println(max);
//            max =  Integer.max(max, list[i] - list[left]);
//            if(list[i] < list[left])
//                left = i;
//        }
//
//        return max;
//    }
}

Compiler output:
Main.java:11: error: class Algorithm is public, should be declared in a file named Algorithm.java
public class Algorithm {
       ^
Main.java:3: error: package org.apache.commons.lang does not exist
import org.apache.commons.lang.StringUtils;
                              ^
2 errors
Language: Java

package javaTest;


import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created by Lenovo on 2017/6/30.
 */
public class Algorithm {
    public static void main(String[] args){
//        int n = 7;
//        int list[] = {5,3,1,3,4,2,6};
//        int result = getMax(n,list);
//        System.out.println(result);
        Scanner scanner = new Scanner(System.in);
        String[] expr = scanner.nextLine().split(" ");
        LinkedList<Integer> stack = new LinkedList<>();
        for(String str : expr){
            if(str.equals("+") ||str.equals("-") || str.equals("*")){
                int temp,num1 = stack.pop(),num2 = stack.pop();
                switch (str){
                    case "+": temp = num1+num2;
                        break;
                    case "-": temp = num2 - num1;
                        break;
                    default:temp = num1*num2;
                        break;
                }
                stack.push(temp);
            }else{
                stack.push(Integer.valueOf(str));
            }
        }
        System.out.println(stack.pop());
        
    }

//    private static int getMax(int n, int[] list) {
//        int max = Integer.MIN_VALUE, left = 0;
//
//        for(int i = 1; i < n; i++){
//            System.out.println(max);
//            max =  Integer.max(max, list[i] - list[left]);
//            if(list[i] < list[left])
//                left = i;
//        }
//
//        return max;
//    }
}

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

package javaTest;


import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created by Lenovo on 2017/6/30.
 */
public class Algorithm {
    public static int top;
    public static int[] s = new int[1000];
    public static void main(String[] args){
//        int n = 7;
//        int list[] = {5,3,1,3,4,2,6};
//        int result = getMax(n,list);
//        System.out.println(result);
        Scanner scanner = new Scanner(System.in);
        String[] expr = scanner.nextLine().split(" ");
        for(String str : expr){
            if(str.equals("+") ||str.equals("-") || str.equals("*")){
                int temp,num1 = pop(),num2 = pop();
                switch (str){
                    case "+": temp = num1+num2;
                        break;
                    case "-": temp = num2 - num1;
                        break;
                    default:temp = num1*num2;
                        break;
                }
                push(temp);
            }else{
               push(Integer.valueOf(str));
            }
        }
        System.out.println(pop());
        
    }

    public static void push(int x){
        s[++top] = x;
    }

    public static int pop(){
        top --;
        return s[top + 1];
    }

//    private static int getMax(int n, int[] list) {
//        int max = Integer.MIN_VALUE, left = 0;
//
//        for(int i = 1; i < n; i++){
//            System.out.println(max);
//            max =  Integer.max(max, list[i] - list[left]);
//            if(list[i] < list[left])
//                left = i;
//        }
//
//        return max;
//    }
}

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

package javaTest;

import java.util.Scanner;

/**
 * Created by Lenovo on 2017/6/30.
 */
public class Algorithm {
    public static int top = 0;
    public static int[] s = new int[1000];
    public static void main(String[] args){
//        int n = 7;
//        int list[] = {5,3,1,3,4,2,6};
//        int result = getMax(n,list);
//        System.out.println(result);
        Scanner scanner = new Scanner(System.in);
        String[] expr = scanner.nextLine().split(" ");
        for(String str : expr){
            if(str.equals("+") ||str.equals("-") || str.equals("*")){
                int temp,num1 = pop(),num2 = pop();
                switch (str){
                    case "+": temp = num1+num2;
                        break;
                    case "-": temp = num2 - num1;
                        break;
                    default:temp = num1 * num2;
                        break;
                }
                push(temp);
            }else{
               push(Integer.valueOf(str));
            }
        }
        System.out.println(pop());
        
    }

    public static void push(int x){
        s[++top] = x;
    }

    public static int pop(){
        top --;
        return s[top + 1];
    }

//    private static int getMax(int n, int[] list) {
//        int max = Integer.MIN_VALUE, left = 0;
//
//        for(int i = 1; i < n; i++){
//            System.out.println(max);
//            max =  Integer.max(max, list[i] - list[left]);
//            if(list[i] < list[left])
//                left = i;
//        }
//
//        return max;
//    }
}

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

public class Main {

  char[] c;
  int id;

  int exp() {
    int s = term();
    if (id < c.length && '0' <= c[id] && c[id] <= '9') {
      int t = term();
      int op = operand();
      return calc(s, t, op);
    }
    return s;
  }

  int term() {
    int s = number();
    if (id < c.length && '0' <= c[id] && c[id] <= '9') {
      int t = number();
      int op = operand();
      return calc(s, t, op);
    }
    return s;
  }

  int number() {
    int ret = 0;
    while (id < c.length && c[id] != ' ') {
      ret *= 10;
      ret += c[id] - '0';
      id++;
    }
    id++;
    return ret;
  }

  int operand() {
    int ret = c[id];
    id += 2;
    return ret;
  }

  int calc(int s, int t, int op) {
    if (op == '+') {
      return s + t;
    }
    if (op == '-') {
      return s - t;
    }
    if (op == '*') {
      return s * t;
    }
    return -1;
  }

  void run() {
    Scanner sc = new Scanner(System.in);

    c = sc.nextLine().toCharArray();
    // char[] d = "1 2 + 3 4 - *".toCharArray();
    id = 0;
    System.out.println(exp());
  }

  public static void main(String[] args) {
    new Main().run();
  }
}

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

import java.util.Scanner;

class Main{
  String[] data = new String[200];
  int num;

  Stack(){
    this.num = 0;
  }

  boolean push(String c){
    if(this.isFull())
      return false;
    else{
      this.data[++num] = c;
      return true;
    }
  }

  String pop(){
    return this.data[num--];
  }

  boolean isFull(){
    return num == 199;
  }

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


  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int ans;
    int ope1, ope2;
    Stack stack = new Stack();

    while(stdIn.hasNext()){
      String input = stdIn.next();
      if(input.equals("+") || input.equals("-") || input.equals("*")){
        ope2 = Integer.parseInt(stack.pop());
        ope1 = Integer.parseInt(stack.pop());
          if(input.equals("+"))
            ans = ope1 + ope2;
          else if(input.equals("-"))
            ans = ope1 - ope2;
          else
            ans = ope1 * ope2;
        stack.push(Integer.toString(ans));
      }
      else{
        stack.push(input);
      }
    }

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

Compiler output:
Main.java:7: error: invalid method declaration; return type required
  Stack(){
  ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;

class Main{
	public static void main(String[] args)throws Exception{
		Scanner scanner = new Scanner(System.in);
		Deque<Integer> stack = new ArrayDeque<>();
		String[] line = scanner.nextLine().split(" ");
		int a,b;

		for(int i = 0; i < line.length; i++){
			switch(line[i]{
				case "+":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b + a);
					break;

				case "-":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b - a);
					break;

				case "*":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b * a);
					break;

				default :
					stack.offer(Interger.parseInt(line[i])
					break;
			})
		}

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

Compiler output:
Main.java:14: error: ')' expected
			switch(line[i]{
			              ^
Main.java:34: error: ')' or ',' expected
					stack.offer(Interger.parseInt(line[i])
					                                      ^
Main.java:36: error: illegal start of expression
			})
			 ^
3 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;

class Main{
	public static void main(String[] args)throws Exception{
		Scanner scanner = new Scanner(System.in);
		Deque<Integer> stack = new ArrayDeque<>();
		String[] line = scanner.nextLine().split(" ");
		int a,b;

		for(int i = 0; i < line.length; i++){
			switch(line[i]){
				case "+":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b + a);
					break;

				case "-":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b - a);
					break;

				case "*":
					a = stack.pollLast();
					b = stack.pollLast();
					stack.offer(b * a);
					break;

				default :
					stack.offer(Interger.parseInt(line[i]));
					break;
			}
		}

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

Compiler output:
Main.java:34: error: cannot find symbol
					stack.offer(Interger.parseInt(line[i]));
					            ^
  symbol:   variable Interger
  location: class Main
1 error
Language: Java

package chapter4;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class StackWithLib {

    public StackWithLib() {
    }

    public static void main(String[] args) {
        new StackWithLib().solve();
    }

    private Scanner sc;

    private void solve() {
        sc = new Scanner(System.in);
        Deque<String> stack = new ArrayDeque<String>();
        String line = sc.nextLine();
        String[] a = line.split(" ");
        for (String s : a) {
            if ("+".equals(s)) {
                int n1 = Integer.parseInt(stack.pop());
                int n2 = Integer.parseInt(stack.pop());
                stack.push(String.valueOf(n1 + n2));
            } else if ("-".equals(s)) {
                int n1 = Integer.parseInt(stack.pop());
                int n2 = Integer.parseInt(stack.pop());
                stack.push(String.valueOf(n2 - n1));
            } else if ("*".equals(s)) {
                int n1 = Integer.parseInt(stack.pop());
                int n2 = Integer.parseInt(stack.pop());
                stack.push(String.valueOf(n1 * n2));
            } else {
                stack.push(s);
            }
        }
        System.out.println(stack.pop());
    }
}

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

import java.util.Scanner;

public class Stack {

    static int top = 0;
    static int[] num = new int[1000];

    public static void push(int x){

        num[++top] = x;
    }

    public static int pop(){

        top--;
        return num[top+1];
    }

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();

        char[] chars = str.toCharArray();
        for (int i=0; i<chars.length; i++){
            if (chars[i] == '+'){
                int a = pop();
                int b = pop();
                push(a+b);
            }
            else if (chars[i] == '-'){
                int a = pop();
                int b = pop();
                push(b-a);
            }
            else if (chars[i] == '*'){
                int a = pop();
                int b = pop();
                push(a*b);
            }
            else if (chars[i] == ' '){
               continue;
            }
            else {
                push(Integer.parseInt(String.valueOf(chars[i])));
            }
        }

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

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int stack[] = new int[1000];

		Scanner scanner = new Scanner(System.in);
		int counta = 0;
		while (scanner.hasNext()) {
			String sc = scanner.next();
			System.out.println(sc);
			if (sc.charAt(0) == '*') {
				stack[counta - 2] = stack[counta - 2] * stack[counta - 1];
				counta = counta - 2;
			} else if (sc.charAt(0) == '+') {
				stack[counta - 2] = stack[counta - 2] + stack[counta - 1];
				counta = counta - 2;

			} else if (sc.charAt(0) == '-') {
				stack[counta - 2] = stack[counta - 2] - stack[counta - 1];
				counta = counta - 2;

			} else {
				stack[counta] = Integer.parseInt(sc);
				counta++;
			}
		}
		System.out.println(stack[counta]);
	}


Compiler output:
Main.java:29: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int stack[] = new int[1000];

		Scanner scanner = new Scanner(System.in);
		int counta = 0;
		String input[] = (scanner.nextLine()).split(" ");

		for (int i = 0; i < input.length; i++) {
			if (input[i].equals("*")) {
				stack[counta - 2] = stack[counta - 2] * stack[counta - 1];
				counta = counta - 2;
			} else if (input[i].equals("+")) {
				stack[counta - 2] = stack[counta - 2] + stack[counta - 1];
				counta = counta - 2;

			} else if (input[i].equals("-")) {
				stack[counta - 2] = stack[counta - 2] - stack[counta - 1];
				counta = counta - 2;

			} else {
				stack[counta] = Integer.parseInt(input[i]);
				counta++;
			}
		}
		System.out.println(stack[counta]);
	}


Compiler output:
Main.java:29: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.*;
public class AOJ_stack{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str;
        ArrayDeque<Integer> stack =new ArrayDeque<Integer>();
        while (sc.hasNext()) {
            str= sc.next();
            if(str.equals("+")){
                stack.push(stack.pop()+stack.pop());
            } else if (str.equals("-")){
                stack.push((stack.pop()*-1)+stack.pop());
            } else if (str.equals("*")){
                stack.push(stack.pop()*stack.pop());
            } else {
                stack.push(Integer.parseInt(str));
            }
        }
        System.out.println(stack.pop());
    }
}


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

import java.util.Scanner;
public class Aizu{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
    	int[] stack = new int[100];
    	int now = 0;
    	while(scan.hasNext()){
    		String line = scan.next();
    		switch(line){
    			case "+":
    				stack[now - 2] += stack[now - 1];
    				now--;
    				break;
    			case "-":
    				stack[now - 2] -= stack[now - 1];
    				now--;
    				break;
    			case "*":
    				stack[now - 2] *= stack[now - 1];
    				now--;
    				break;
    			default:
	    			stack[now] = Integer.parseInt(line);
    				now++;
    		}
    	}
    	System.out.println(stack[0]);
    }
}


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

#include <stdio.h>
#include <stdlib.h>

int main(){
  char operand[100];
  int *S;
  int count=0;
  int i,j,retrun;
  int a;
  while((scanf("%s ",&operand[count]))=!EOF){   count++;   }
  S = (int *)malloc(count * sizeof(int));
  for(i=0;i<count;i++){
    if(operand[i]==12+32||operand[i]==14+32||operand[i]==11+32){
      for(static k=0; k<i ;k++){
	result[a] += operand[k];
	a++;
      }
    }
    else if(operand[i]==14+32){
      result[a] -= operand[k];
      a++;
    }
    else if(operand[i]==11+32){
      result = a[m]; 
    }
    else{
      j++;
      S[j] =(int)c;
    }
  }
  printf("%d",result);
  return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:6: error: class, interface, enum, or record expected
  int *S;
  ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
  int count=0;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
  int i,j,retrun;
  ^
Main.java:10: error: class, interface, enum, or record expected
  while((scanf("%s ",&operand[count]))=!EOF){   count++;   }
  ^
Main.java:10: error: class, interface, enum, or record expected
  while((scanf("%s ",&operand[count]))=!EOF){   count++;   }
                                                           ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=0;i<count;i++){
  ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=0;i<count;i++){
          ^
Main.java:12: error: class, interface, enum, or record expected
  for(i=0;i<count;i++){
                  ^
Main.java:14: error: class, interface, enum, or record expected
      for(static k=0; k<i ;k++){
                      ^
Main.java:14: error: class, interface, enum, or record expected
      for(static k=0; k<i ;k++){
                           ^
Main.java:16: error: class, interface, enum, or record expected
	a++;
	^
Main.java:17: error: class, interface, enum, or record expected
      }
      ^
Main.java:21: error: class, interface, enum, or record expected
      a++;
      ^
Main.java:22: error: class, interface, enum, or record expected
    }
    ^
Main.java:25: error: class, interface, enum, or record expected
    }
    ^
Main.java:28: error: class, interface, enum, or record expected
      S[j] =(int)c;
      ^
Main.java:29: error: class, interface, enum, or record expected
    }
    ^
Main.java:32: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:33: error: class, interface, enum, or record expected
}
^
22 errors
Language: Java

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

public class A {

    public static void main(String args[]) throws IOException {
        BufferedReader ln = new BufferedReader(new InputStreamReader(System.in));
        String[] str = ln.readLine().split("\\s");

        Stack<Integer> que = new Stack<Integer>();
        int a = 0;
        int b = 0;
        for (int i = 0; i < str.length; i++) {
            if (str[i].equals("+")) {
                a = que.pop();
                b = que.pop();
                que.add(b + a);
                continue;
            }
            if (str[i].equals("-")) {
                a = que.pop();
                b = que.pop();
                que.add(b - a);
                continue;
            }
            if (str[i].equals("*")) {
                a = que.pop();
                b = que.pop();
                que.add(b * a);
                continue;
            }
            if (str[i].equals("/")) {
                a = que.pop();
                b = que.pop();
                que.add(b / a);
                continue;
            }
            que.push(Integer.parseInt(str[i]));
        }
        System.out.println(que.pop());
    }
}




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

#include<stdio.h>
#include<stdlib.h>

void push(int);
void pop(int);

int stack[50];
int arryN = 0;

int main(){
  char input[50];
  int bre1 = 0, bre2 = 0;

  while(scanf("%50s",input) != EOF){

    if(input[0] == '+'){
      pop(1);
      bre1++;
    }
    else if(input[0] == '-'){
      pop(2);
      bre1++;
    }
    else if(input[0] == '*'){
      pop(3);
      bre1++;
    }
    else{
     push(atoi(input));
     bre2++;
    }

    if((bre1 > 99) || (bre2 > 100) || ((int)input[0] > 100000) ) break;

  }
  printf("\n%d\n",stack[0]);

  return 0;
}

void push(int input){
  stack[arryN] = input;
  arryN++;
}
void pop(int ks){
  switch(ks){
    case 1:
    stack[arryN - 2] = stack[arryN - 2] + stack[arryN - 1];
    arryN--;
    break;

    case 2:
    stack[arryN - 2] = stack[arryN - 2] - stack[arryN - 1];
    arryN--;
    break;

    case 3:
    stack[arryN - 2] = stack[arryN - 2] * stack[arryN - 1];
    arryN--;
    break;

  }
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
void pop(int);
^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: <identifier> expected
void pop(int);
            ^
Main.java:7: error: class, interface, enum, or record expected
int stack[50];
^
Main.java:11: error: ']' expected
  char input[50];
             ^
7 errors