criyle/codenet-compile-errors huggingface dataset:
Language: Java

public class Main {

	public static void main(String[] args) {
		{
			Scanner stdin = new Scanner(System.in);
			List<Integer> result = new ArrayList<>();
			int i = 0, count = 0;
			while (true) {
				String[] input = stdin.nextLine().split(" ");
				int num1 = 0;
				int num2 = 0;
				char operation = 0;
				num1 = Integer.parseInt(input[0]);
			    operation = input[1].charAt(0);
			    num2 = Integer.parseInt(input[2]);
				if (operation == '?') {
					break;
				}
				switch (operation) {
				case '+':
					result.add(num1 + num2);
					break;

				case '-':
					result.add(num1 - num2);
					break;
				case '*':
					result.add(num1 * num2);
					break;
				case '/':
					result.add(num1 / num2);
					break;
				}
				count = i;
				i++;
			}
			for (int j = 0; j < result.size(); j++) {
				System.out.println(result.get(j));
			}
		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
			Scanner stdin = new Scanner(System.in);
			^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
			Scanner stdin = new Scanner(System.in);
			                    ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
			List<Integer> result = new ArrayList<>();
			^
  symbol:   class List
  location: class Main
Main.java:6: error: cannot find symbol
			List<Integer> result = new ArrayList<>();
			                           ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {		
		Scanner scanner = new Scanner(new BufferedInputStream(System.in));
		ArrayList<String> list = new ArrayList<String>();
		
		while(scanner.hasNext()) {
			String num = scanner.nextLine();
			String[] input = num.split(" ");
			int number1 = Integer.parseInt(input[0]);
			String op = input[1];
			int number2 = Integer.parseInt(input[2]);
			int result = 0;
			if("?" .equals(op)) {
				break;
			}else {
				if(number1 >= 0 && number1 <= 20000 && number2 >= 0 && number2 <= 20000) {
					if("+" .equals(op)) {
						result = number1+number2;
						list.add(String.valueOf(result));
					}else if("-" .equals(op)) {
						result = number1-number2;
						list.add(String.valueOf(result));
					}
					else if("*" .equals(op)) {
						result = number1*number2;
						list.add(String.valueOf(result));
					}
					else if("/" .equals(op)) {
						result = number1/number2;
						list.add(String.valueOf(result));
					}
				}
			}			
		}
		for(String str : list){
			System.out.println(str);
		}

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

import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {		
		Scanner scanner = new Scanner(new BufferedInputStream(System.in));
		List<String> list = new ArrayList<String>();
		
		while(scanner.hasNext()) {
			String num = scanner.nextLine();
			String[] input = num.split(" ");
			int number1 = Integer.parseInt(input[0]);
			String op = input[1];
			int number2 = Integer.parseInt(input[2]);
			int result = 0;
			if("?" .equals(op)) {
				break;
			}else {
				if(number1 >= 0 && number1 <= 20000 && number2 >= 0 && number2 <= 20000) {
					if("+" .equals(op)) {
						result = number1+number2;
						list.add(String.valueOf(result));
					}else if("-" .equals(op)) {
						result = number1-number2;
						list.add(String.valueOf(result));
					}
					else if("*" .equals(op)) {
						result = number1*number2;
						list.add(String.valueOf(result));
					}
					else if("/" .equals(op)) {
						result = number1/number2;
						list.add(String.valueOf(result));
					}
				}
			}			
		}
		for(String str : list){
			System.out.println(str);
		}

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

import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {		
		Scanner scanner = new Scanner(new BufferedInputStream(System.in));
		List<String> list = new ArrayList<String>();
		
		while(scanner.hasNext()) {
			String num = scanner.nextLine();
			String[] input = num.split(" ");
			int number1 = Integer.parseInt(input[0]);
			String op = input[1];
			int number2 = Integer.parseInt(input[2]);
			int result = 0;
			if("?" .equals(op)) {
				break;
			}else {
				if(number1 >= 0 && number1 <= 20000 && number2 >= 0 && number2 <= 20000) {
					if("+" .equals(op)) {
						result = number1+number2;
						list.add(String.valueOf(result));
					}else if("-" .equals(op)) {
						result = number1-number2;
						list.add(String.valueOf(result));
					}
					else if("*" .equals(op)) {
						result = number1*number2;
						list.add(String.valueOf(result));
					}
					else if("/" .equals(op)) {
						result = number1/number2;
						list.add(String.valueOf(result));
					}
				}
			}			
		}
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}

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

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNextLine()){
			String[] input = scanner.nextLine().split(" ");
			int a = Integer.parseInt(input[0]);
			int b = Integer.parseInt(input[2]);

			if(input[1].equals("+")){
				System.out.println(a+b);
			}else if(input[1].equals("-")){
				System.out.println(a-b);
			}else if(input[1].equals("*")){
				System.out.println(a*b);
			}else if(input[1].equals("/")){
				System.out.println(a/b);
			}else{break;}
	}
}

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


import java.util.Scanner;


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

		Outer:
			while(true){
				int a = sc.nextInt();
				char b = sc.next().charAt(0);
				int c = sc.nextInt();
				int result = 0;
				switch(b){
				case '+': result = a + c; break;
				case '-': result = a - c; break;
				case '*': result = a * c; break;
				case '/': result = a / c; break;
				case '%': result = a % c; break;
				case '?': break Outer;
				default : continue Outer;
				}
				System.out.println(result);
			}
	}
}




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

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	System.out.println("Hello");
	int q = scan.nextInt();
	String value = scan.next();
	int w = scan.nextInt();
	System.out.println(q);
	System.out.println(value);
	System.out.println(w);
	String add = "+";
	String subtract = "-";
	String multiply = "*";
	String division = "/";
String question = "?";
	int answer = 9;
	while (answer != 5) {
	if (value.equals(add)) {
		System.out.println("true");
		answer = q + w;
	} else if (value.equals(subtract)) {
		answer = q - w;
	}else if (value.equals(multiply)) {
		answer = q * w;
	} else if (value.equals(division)){
		answer = q / w;
	} else if (value.equals(question){
		break;
	}
	System.out.println(answer);
}
}
}



Compiler output:
Main.java:28: error: ')' expected
	} else if (value.equals(question){
	                                 ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
System.out.println(3);
	String add = "+";
	String subtract = "-";
	String multiply = "*";
	String division = "/";
	int answer = 9;
/*	while (answer != 5) {
System.out.println(3);
		Scanner scan = new Scanner(System.in);
		int q = scan.nextInt();
		String value = scan.next();
		int w = scan.nextInt();
	if (value.equals(add)) {
		System.out.println("true");
		answer = q + w;
	} else if (value.equals(subtract)) {
		answer = q - w;
	}else if (value.equals(multiply)) {
		answer = q * w;
	} else if (value.equals(division)){
		answer = q / w;
	} else {
		break;
	}
	System.out.println(answer);
}
} */
}





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

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
	String add = "+";
	String subtract = "-";
	String multiply = "*";
	String division = "/";
		Scanner scan = new Scanner(System.in);
		int q = scan.nextInt();
		String value = scan.next();
		int w = scan.nextInt();
	int answer = 20;
	while (true) {
	if (value.equals(add)) {
		answer = q + w;
	} else if (value.equals(subtract)) {
		answer = q - w;
	}else if (value.equals(multiply)) {
		answer = q * w;
	} else if (value.equals(division)){
		answer = q / w;
	} else {
		break;
	}

	System.out.println(answer);
		int q = scan.nextInt();
		String value = scan.next();
		int w = scan.nextInt();
}
} 
}




Compiler output:
Main.java:28: error: variable q is already defined in method main(String[])
		int q = scan.nextInt();
		    ^
Main.java:29: error: variable value is already defined in method main(String[])
		String value = scan.next();
		       ^
Main.java:30: error: variable w is already defined in method main(String[])
		int w = scan.nextInt();
		    ^
3 errors
Language: Java

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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        ArrayList<Integer> a = new ArrayList<>();
        ArrayList<String> op = new ArrayList<>();
        ArrayList<Integer> b = new ArrayList<>();
        
        while(true){
            String[] line = br.readLine().split(" ");
            if ("?".equals(line[1])) {
                break;
            }
            a.add(Integer.parseInt(line[0]));
            op.add(line[1]);
            b.add(Integer.parseInt(line[2]));
        }
        for(int i=0;i<a.size();i++){
            if("+".equals(op.get(i))){
                System.out.println(a.get(i) + b.get(i));
            }else if("-".equals(op.get(i))){
                System.out.println(a.get(i) - b.get(i));
            }else if("*".equals(op.get(i))){
                System.out.println(a.get(i) * b.get(i));
            }else if("/".equals(op.get(i))){
                System.out.println(a.get(i) / b.get(i));
            }
        }
    }
}
© 2018 GitHub, Inc.


Compiler output:
Main.java:36: error: illegal character: '\u00a9'
? 2018 GitHub, Inc.
^
Main.java:36: error: class, interface, enum, or record expected
? 2018 GitHub, Inc.
       ^
2 errors
Language: Java

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = 0;
    char c = 0;
    int b = 0;
    while (true) {
      a = sc.nextInt();
      op = sc.next();
      b = sc.nextInt();
      if (op == '?') break;
      switch (op) {
        case '+' :
          System.out.println(a + b); break;
        case '-' :
          System.out.println(a - b); break;
        case '*' :
          System.out.println(a * b); break;
        case '/' :
          System.out.println(a / b); break;
       }
    }
}


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

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = 0;
    char op = 0;
    int b = 0;
    while (true) {
      a = sc.nextInt();
      op = sc.next();
      b = sc.nextInt();
      if (op == '?') break;
      switch (op) {
        case '+' :
          System.out.println(a + b); break;
        case '-' :
          System.out.println(a - b); break;
        case '*' :
          System.out.println(a * b); break;
        case '/' :
          System.out.println(a / b); break;
       }
    }
}


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

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = 0;
    String op = null;
    int b = 0;
    while (true) {
      a = sc.nextInt();
      op = sc.next();
      b = sc.nextInt();
      if (op == "?") break;
      switch (op) {
        case "+" :
          System.out.println(a + b); break;
        case "-" :
          System.out.println(a - b); break;
        case "*" :
          System.out.println(a * b); break;
        case "/" :
          System.out.println(a / b); break;
       }
    }
}


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

import java.util.Scanner;

class Main {

public static void main(String[] args) {

Scanner inp = new Scanner(System.in);
int a, b, op;
boolean start = true;

while (start == true)

Switch (op) {

case '+' :
System.out.println(a+b);
break;

case '-' :
System.out.println(a-b);
break;

case '/' :
if (b!=0) System.out.println(a/b);
break;

case '*' :
if (b!=0) System.out.println(a*b);
break;

case '?' :
start = false;
break;

}

}
}


Compiler output:
Main.java:13: error: ';' expected
Switch (op) {
           ^
Main.java:15: error: orphaned case
case '+' :
^
2 errors
Language: Java

import java.util.Scanner;

class Main {

public static void main(String[] args) {

Scanner inp = new Scanner(System.in);

while (true)

int a = inp.nextInt();
String op = inp.next();
int b = inp.nextInt();

if(op.equals("?"))break;

Switch (op) {

case "+" :
System.out.println(a+b);
break;

case "-" :
System.out.println(a-b);
break;

case "/" :
if (b!=0) System.out.println(a/b);
break;

case "*" :
if (b!=0) System.out.println(a*b);
break;

}

}
}


Compiler output:
Main.java:11: error: variable declaration not allowed here
int a = inp.nextInt();
    ^
Main.java:17: error: ';' expected
Switch (op) {
           ^
Main.java:19: error: orphaned case
case "+" :
^
3 errors
Language: Java

import java.util.*; class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); while(true) { int a = sc.nextInt(); String d = sc.next(); int b = sc.nextInt(); if(d.equals("?")) break; if(d.equals("+")) System.out.println(a + b); if(d.equals("-")) System.out.println(a - b); if(d.equals("*")) System.out.println(a * b); if(d.equals("/")) System.out.println(a / b); } } 


Compiler output:
Main.java:1: error: reached end of file while parsing
import java.util.*; class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); while(true) { int a = sc.nextInt(); String d = sc.next(); int b = sc.nextInt(); if(d.equals("?")) break; if(d.equals("+")) System.out.println(a + b); if(d.equals("-")) System.out.println(a - b); if(d.equals("*")) System.out.println(a * b); if(d.equals("/")) System.out.println(a / b); } } 
                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
1 error
Language: Java

import java.io.*;

public class Main
{
  public static void main(String[] args)
  {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    while (true)
    {
      String line = reader.readline();
      String[] ops = line.split(" ", 0);

      if (ops == "+")
      {
        System.out.println(ops[0] + ops[2]);
      }
      else if (ops == "-")
      {
        System.out.println(ops[0] - ops[2]);
      }
      else if (ops == "*")
      {
        System.out.println(ops[0] * ops[2]);
      }
      else if (ops == "/")
      {
        System.out.println(ops[0] / ops[2]);
      }
      else
      {
        break;
      }
    }
  }
}


Compiler output:
Main.java:11: error: cannot find symbol
      String line = reader.readline();
                          ^
  symbol:   method readline()
  location: variable reader of type BufferedReader
Main.java:14: error: incomparable types: String[] and String
      if (ops == "+")
              ^
Main.java:18: error: incomparable types: String[] and String
      else if (ops == "-")
                   ^
Main.java:20: error: bad operand types for binary operator '-'
        System.out.println(ops[0] - ops[2]);
                                  ^
  first type:  String
  second type: String
Main.java:22: error: incomparable types: String[] and String
      else if (ops == "*")
                   ^
Main.java:24: error: bad operand types for binary operator '*'
        System.out.println(ops[0] * ops[2]);
                                  ^
  first type:  String
  second type: String
Main.java:26: error: incomparable types: String[] and String
      else if (ops == "/")
                   ^
Main.java:28: error: bad operand types for binary operator '/'
        System.out.println(ops[0] / ops[2]);
                                  ^
  first type:  String
  second type: String
8 errors
Language: Java

import java.util.Scanner;

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

        int a = sc.nextInt();
        char op = sc.nextCaractor();
        int b = sc.nextInt();

        while(op != '?')
        {
            if(op = '+')
                System.out.println(a + b);
            if(op = '-')
                System.out.println(a - b);
            if(op = '*')
                System.out.println(a * b);
            if(op = '/')
                System.out.println(a / b);

            a = sc.nextInt();
            op = sc.nextCaractor();
            b = sc.nextInt();
        }
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        char op = sc.nextCaractor();
                    ^
  symbol:   method nextCaractor()
  location: variable sc of type Scanner
Main.java:13: error: incompatible types: char cannot be converted to boolean
            if(op = '+')
                  ^
Main.java:15: error: incompatible types: char cannot be converted to boolean
            if(op = '-')
                  ^
Main.java:17: error: incompatible types: char cannot be converted to boolean
            if(op = '*')
                  ^
Main.java:19: error: incompatible types: char cannot be converted to boolean
            if(op = '/')
                  ^
Main.java:23: error: cannot find symbol
            op = sc.nextCaractor();
                   ^
  symbol:   method nextCaractor()
  location: variable sc of type Scanner
6 errors
Language: Java

import java.util.Scanner;

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

        int a = sc.nextInt();
        char op = sc.nextCaractor();
        int b = sc.nextInt();

        while(op != '?')
        {
            if(op == '+')
                System.out.println(a + b);
            if(op == '-')
                System.out.println(a - b);
            if(op == '*')
                System.out.println(a * b);
            if(op == '/')
                System.out.println(a / b);

            a = sc.nextInt();
            op = sc.nextCaractor();
            b = sc.nextInt();
        }
    }
}


Compiler output:
Main.java:3: error: class symple_calc is public, should be declared in a file named symple_calc.java
public class symple_calc {
       ^
Main.java:8: error: cannot find symbol
        char op = sc.nextCaractor();
                    ^
  symbol:   method nextCaractor()
  location: variable sc of type Scanner
Main.java:23: error: cannot find symbol
            op = sc.nextCaractor();
                   ^
  symbol:   method nextCaractor()
  location: variable sc of type Scanner
3 errors
Language: Java

import java.util.Scanner;
 
public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
 
    while (true)
    {
      int operand1 = sc.nextInt();
      char operator = sc.nextChar();
      int operand2 = sc.nextInt();

      switch(operator)
      {
      case '+':
        System.out.println(operand1 + operand2);
        break;
      case '-':
        System.out.println(operand1 - operand2);
        break;
      case '*':
        System.out.println(operand1 * operand2);
        break;
      case '/':
        System.out.println(operand1 / operand2);
        break;
      case '?':
        return;
      }
    }
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
      char operator = sc.nextChar();
                        ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.Scanner;

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

        int a = sc.nextInt();
        char op = sc.nextChar();
        int b = sc.nextInt();

        while(op != '?')
        {
            if(op == '+')
                System.out.println(a + b);
            if(op == '-')
                System.out.println(a - b);
            if(op == '*')
                System.out.println(a * b);
            if(op == '/')
                System.out.println(a / b);

            a = sc.nextInt();
            op = sc.nextChar();
            b = sc.nextInt();
        }
    }
}


Compiler output:
Main.java:3: error: class symple_calc is public, should be declared in a file named symple_calc.java
public class symple_calc {
       ^
Main.java:8: error: cannot find symbol
        char op = sc.nextChar();
                    ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
Main.java:23: error: cannot find symbol
            op = sc.nextChar();
                   ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
3 errors
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
        int a = sc.nextInt();
        char op = sc.next();
        int b = sc.nextInt();
        if(op == '+') System.out.println(a+b);
        if(op == '-') System.out.println(a-b);
        if(op == '*') System.out.println(a*b);
        if(op == '/') System.out.println(a/b);
        if(op == '?') break;
        }
    }
}


Compiler output:
Main.java:8: error: incompatible types: String cannot be converted to char
        char op = sc.next();
                         ^
1 error
Language: Java

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (flag) {
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();

			switch (op) {
			case "+":
				System.out.println((a + b));
				break;
			case "-":
				System.out.println((a - b));
				break;
			case "*":
				System.out.println((a * b));
				break;
			case "/":
				System.out.println((a / b));
				break;
			case "?":
				flag = false;
				break;
			}

		}

	}
}



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

import java.util.Scanner;

public class SimpleCalculator {
	public static void main(String args[]) {
		String op = null;
		while (op != "?") {
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			op = sc.next();
			int b = sc.nextInt();
			int ans;
			if (op == "+") {
				ans = a + b;
			} else if (op == "-") {
				ans = a - b;
			} else if (op == "/") {
				if (b == 0) {
					sc.close();
				}
				ans = a / b;
			} else {
				ans = a * b;
			}
			System.out.println(ans);
			sc.close();
		}
	}
}



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

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        while(true){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();        
        String op =sc.nextLine();
        if(op.equals("+")){
            int aopb = a+b;
        }
        if(op.equals("-")){
            int aopb = a-b;
        }
        if(op.equals("*")){
            int aopb = a*b;
        }
        if(op.equals("/")){
            int aopb = a/b;
        }
        if(op.equals("?")){
            break;
        }
        System.out.println(aopb);
        }
    }
}


Compiler output:
Main.java:24: error: cannot find symbol
        System.out.println(aopb);
                           ^
  symbol:   variable aopb
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        char op = sc.nextCharactor();
        if (op == '?') {
            System.out.println("Error.");
            System.exit();
        }
        int b = nextInt();
        if (b == 0) {
            if (op == '/') {
                System.out.println("Error.");
                System.exit();
            }
        }
        System.out.println(a + op + b);
    }
}


Compiler output:
Main.java:7: error: cannot find symbol
        char op = sc.nextCharactor();
                    ^
  symbol:   method nextCharactor()
  location: variable sc of type Scanner
Main.java:10: error: method exit in class System cannot be applied to given types;
            System.exit();
                  ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
Main.java:12: error: cannot find symbol
        int b = nextInt();
                ^
  symbol:   method nextInt()
  location: class Main
Main.java:16: error: method exit in class System cannot be applied to given types;
                System.exit();
                      ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
4 errors
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        char op = sc.nextChar();
        if (op == '?') {
            System.out.println("Error.");
            System.exit();
        }
        int b = sc.nextInt();
        if (b == 0) {
            if (op == '/') {
                System.out.println("Error.");
                System.exit();
            }
        }
        System.out.println(a + op + b);
    }
}


Compiler output:
Main.java:7: error: cannot find symbol
        char op = sc.nextChar();
                    ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
Main.java:10: error: method exit in class System cannot be applied to given types;
            System.exit();
                  ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
Main.java:16: error: method exit in class System cannot be applied to given types;
                System.exit();
                      ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
3 errors
Language: Java

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

class Main{
    public static void main(String[]args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            try {
                String line = br.readLine();
                String[] lines = line.split(" ", 0);
                int a = Integer.parseInt(lines[0]);
                char op = lines[1].charAt(0);
                int b = Integer.parseInt(lines[2]);

                if (op == '+') {
                    System.out.println(a + b);
                } else if (op == '-') {
                    System.out.println(a - b);
                } else if (op == '*') {
                    System.out.println(a * b);
                } else if (op == '/') {
                    System.out.println(a / b);
                } else break;
            } catch (NumberFormatException e) {
                return;
            }
        


    }
}


Compiler output:
Main.java:24: error: break outside switch or loop
                } else break;
                       ^
1 error
Language: Java

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

class Main{
    public static void main(String[]args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            try {
                String line = br.readLine();
                String[] lines = line.split(" ", 0);
                int a = Integer.parseInt(lines[0]);
                char op = lines[1].charAt(0);
                int b = Integer.parseInt(lines[2]);

                if (op == '+') {
                    System.out.println(a + b);
                } else if (op == '-') {
                    System.out.println(a - b);
                } else if (op == '*') {
                    System.out.println(a * b);
                } else if (op == '/') {
                    System.out.println(a / b);
                } else return;
            } catch (NumberFormatException e) {
                return;
            }



    }
}


Compiler output:
Main.java:10: error: unreported exception IOException; must be caught or declared to be thrown
                String line = br.readLine();
                                         ^
1 error
Language: Java

import java.util.Scanner;

public class SimpleCalculator {
	public static void main(String args[]) {
		String op = null;
		while (!op.equals(?)) {
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			op = sc.next();
			int b = sc.nextInt();
			int ans;
			if (op.equals("+")) {
				ans = a + b;
			} else if (op.equals("-")) {
				ans = a - b;
			} else if (op.equals("/")) {
				if (b == 0) {
					sc.close();
				}
				ans = a / b;
			} else {
				ans = a * b;
			}
			System.out.println(ans);
			sc.close();
		}
	}
}


Compiler output:
Main.java:6: error: illegal start of expression
		while (!op.equals(?)) {
		                  ^
Main.java:6: error: illegal start of expression
		while (!op.equals(?)) {
		                   ^
2 errors
Language: Java

import java.io.*;
public class Try{
  public static void main(String[]args)throws IOException{
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    while(1>0){
      int a=Integer.parseInt(br.readLine());

      String c=br.readLine();

      int b=Integer.parseInt(br.readLine());

      if( c.equals("?") ) System.exit(0);

      if( c.equals("+") )  System.out.print(a+b);
      if( c.equals("-") ) System.out.print(a-b);
      if( c.equals("*") ) System.out.print(a*b);
      if( c.equals("/") ) System.out.print((int)a/b);
    }

  }
}


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

import java.util.Scanner;

public class Main5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        char op = sc.next().charAt(0);        
        int b = sc.nextInt();
        if (op == '+') {
            System.out.println(a + b);
        } else if(op == '-') {
            System.out.println(a - b);
        } else if(op == '*') {
            System.out.println(a * b);
        } else if(op == '/') {
            System.out.println(a / b);
        } else if(op == '?') {
            return;
        }
    }
}




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

import java.io.*;
public class Main{
  public static void main(String[]args)throws IOException{
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

    while(ture){
      int a=Integer.parseInt(br.readLine());

      String c=br.readLine();

      int b=Integer.parseInt(br.readLine());

      if( c.equals("?") ) System.exit(0);

      if( c.equals("+") )  System.out.print(a+b);
      if( c.equals("-") ) System.out.print(a-b);
      if( c.equals("*") ) System.out.print(a*b);
      if( c.equals("/") ) System.out.print((int)a/b);
    }

  }
}



Compiler output:
Main.java:6: error: cannot find symbol
    while(ture){
          ^
  symbol:   variable ture
  location: class Main
1 error
Language: Java

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			String op = sc.next();
			if(op.equals("?"))break;
			int b = sc.nextInt();
			switch(op){
			case "+":
				System.out.println(a+b);
				break;
			case "-":
				System.out.println(a-b);
				break;
			case "*":
				System.out.println(a*b);
				break;
			case "/":
				System.out.println(a/b);
				break;
			default:
				return;
			}
		}
	}
}


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

import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = 0;
        String s = "";
        int b = 0;
        do{
            a = sc.nextInt();
            s = sc.next();
            b = sc.nextInt();

            if(s.equals("+")){
                System.out.println(a + b);
            }
            else if(s.equals("-")){
                System.out.println(a - b);
            }
            else if(s.equals("*")){
                System.out.println(a * b);
            }
            else if(s.equals("/")){
                if(b != 0) System.out.println(a / b);
                else System.out.println()
            }
            else{
                a = 0;
                s = "";
                b = 0;
            }
        }while(!(s.equals("?")));
    }
}


Compiler output:
Main.java:24: error: ';' expected
                else System.out.println()
                                         ^
1 error
Language: Java

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			String op = sc.next();
			if(op.equals("?"))break;
			int b = sc.nextInt();
			switch(op){
			case "+":
				System.out.println(a+b);
				break;
			case "-":
				System.out.println(a-b);
				break;
			case "*":
				System.out.println(a*b);
				break;
			case "/":
				System.out.println(a/b);
				break;
			default:
				break;
			}
		}
	}
}


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

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			switch(op){
			case "+":
				System.out.println(a+b);
				break;
			case "-":
				System.out.println(a-b);
				break;
			case "*":
				System.out.println(a*b);
				break;
			case "/":
				System.out.println(a/b);
				break;
			default:
				return;
			}
		}
	}
}


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

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			switch(op){
			case "+":
				System.out.println(a+b);
				break;
			case "-":
				System.out.println(a-b);
				break;
			case "*":
				System.out.println(a*b);
				break;
			case "/":
				System.out.println(a/b);
				break;
			default:
				return 0;
			}
		}
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:22: error: incompatible types: unexpected return value
				return 0;
				       ^
3 errors
Language: Java

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			String op = sc.next();
			if(op.equals("?"))break;
			int b = sc.nextInt();
			switch(op){
			case "+":
				System.out.println(a+b);
				break;
			case "-":
				System.out.println(a-b);
				break;
			case "*":
				System.out.println(a*b);
				break;
			case "/":
				System.out.println(a/b);
				break;
			default:
				break;
			}
		}
	}
}


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

#include <stdio.h>

int main(){
    int a, b;
    char op;
    while(1){
        scanf("%d %c %d", &a, &op, &b);
        if(op=='?'){
            break;
        }else if(op=='+'){
            printf("%d\n", a+b);
        }else if(op=='-'){
            printf("%d\n", a-b);
        }else if(op=='*'){
            printf("%d\n", a*b);
        }else if(op=='/'){
            printf("%d\n", a/b);
        }
    }
    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:5: error: unnamed classes are a preview feature and are disabled by default.
    char op;
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: class, interface, enum, or record expected
    while(1){
    ^
Main.java:8: error: class, interface, enum, or record expected
        if(op=='?'){
        ^
Main.java:10: error: class, interface, enum, or record expected
        }else if(op=='+'){
        ^
Main.java:12: error: class, interface, enum, or record expected
        }else if(op=='-'){
        ^
Main.java:14: error: class, interface, enum, or record expected
        }else if(op=='*'){
        ^
Main.java:16: error: class, interface, enum, or record expected
        }else if(op=='/'){
        ^
Main.java:18: error: class, interface, enum, or record expected
        }
        ^
Main.java:21: error: class, interface, enum, or record expected
}
^
11 errors
Language: Java


int main(){
    int a, b;
    char op;
    while(1){
        scanf("%d %c %d", &a, &op, &b);
        if(op=='?'){
            break;
        }else if(op=='+'){
            printf("%d\n", a+b);
        }else if(op=='-'){
            printf("%d\n", a-b);
        }else if(op=='*'){
            printf("%d\n", a*b);
        }else if(op=='/'){
            printf("%d\n", a/b);
        }
    }
    return 0;
}


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: illegal start of expression
        scanf("%d %c %d", &a, &op, &b);
                          ^
Main.java:6: error: illegal start of expression
        scanf("%d %c %d", &a, &op, &b);
                              ^
Main.java:6: error: illegal start of expression
        scanf("%d %c %d", &a, &op, &b);
                                   ^
4 errors
Language: Java

import java.util.Scanner;


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


        switch(b){

        case"+":
        answer = a+c;
        break;

        case"-":
        answer = a-c;
        break;

        case"*":
        answer = a*c;
        break;
        
        case"/":
        answer = a/c;
        break;

        default:
        return;

        }
        

        System.out.println(answer);

    }
    
}



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

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        
        
            Scanner sc = new Scanner(System.in);
            int a = sc.nextInt();
            String op = sc.next();
            int b = sc.nextInt();
            int answer;
            switch (op){
                case "+":
                answer = a + b;
                break;
                case "-":
                answer = a - b;
                break;
                case "*":
                answer = a * b;
                break;
                case "/":
                answer = a / b;
                break;
                default:
                return;

                                                   }
        
           System.out.printf(answer);
        
    }
}


Compiler output:
Main.java:29: error: no suitable method found for printf(int)
           System.out.printf(answer);
                     ^
    method PrintStream.printf(String,Object...) is not applicable
      (argument mismatch; int cannot be converted to String)
    method PrintStream.printf(Locale,String,Object...) is not applicable
      (argument mismatch; int cannot be converted to Locale)
1 error
Language: Java

import java.util.Scanner;
public class great {
	public static void main(String[] args) {
	 try {		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String a = sc.next();
		char op = a.charAt(0);
		int B = sc.nextInt();		 		
		if(op=='+') {
			System.out.println(n+B);
		}
		else if(op=='-'){
			System.out.println(n-B);
		}
		else if(op=='*') {
			System.out.println(n*B);
		}
		else if(op=='/') {
			System.out.println(n/B);
		}
		else if(op=='?') {
			System.out.println(" ");
		}
	    sc.close();   
		}catch (Exception e) {
            System.out.println("例外が発生しました。");
            System.out.println(e);
 
            
		}
		}
	}


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

import java.util.Scanner;

public class five {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner (System.in)) {
            while (true) {
                int a = sc.nextInt();
                String op = sc.next();
                int b = sc.nextInt();
                int answer;
                switch (op) {
                    case "+":
                        answer = a + b;
                        break;
                    case "-":
                        answer = a - b;
                        break;
                    case "*":
                        answer = a * b;
                        break;
                    case "/":
                        answer = a / b;
                        break;
                    default:
                        return;
                }
                System.out.println(answer);
            }
        }
    }
}



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

import java.util.Scanner;

public class five {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner (System.in)) {
            while (true) {
                int a = sc.nextInt();
                String op = sc.next();
                int b = sc.nextInt();
                int answer;
                switch (op) {
                    case "+";
                        answer = a + b;
                        break;
                    case "-";
                        answer = a - b;
                        break;
                    case "*";
                        answer = a * b;
                        break;
                    case "/";
                        answer = a / b;
                        break;
                    default;
                        return;
                }
                System.out.println(answer);
            }
        }
    }
}



Compiler output:
Main.java:12: error: : or -> expected
                    case "+";
                            ^
Main.java:15: error: : or -> expected
                    case "-";
                            ^
Main.java:18: error: : or -> expected
                    case "*";
                            ^
Main.java:21: error: : or -> expected
                    case "/";
                            ^
Main.java:24: error: : or -> expected
                    default;
                           ^
5 errors
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			switch (op) {
			case "+":
				System.out.println(a + b);
				break;
			case "-":
				System.out.println(a - b);
				break;
			case "*":
				System.out.println(a * b);
				break;
			case "/":
				System.out.println(a / b);
				break;
			default:
				break;
			}
			if (op.equals("?"))break;
		}
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: 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{
  public static void main(String args[]){
    new Scanner sc = Scanner(system.in);

    while(true){
      int a = sc.nextInt();
      String op = sc.nextString();
      int b = sc.nextInt();

      if(op == "?"){
        println(a+" "+op+" "+b);
      }false{
        break;
      }
    }
  }
}


Compiler output:
Main.java:5: error: '(' or '[' expected
    new Scanner sc = Scanner(system.in);
                ^
Main.java:14: error: not a statement
      }false{
       ^
Main.java:14: error: ';' expected
      }false{
            ^
3 errors
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(system.in);

    while(true){
      int a = sc.nextInt();
      String op = sc.nextString();
      int b = sc.nextInt();

      if(op == "?"){
        break;
      }false{
        println(a+op+b);
      }
    }
  }
}


Compiler output:
Main.java:14: error: not a statement
      }false{
       ^
Main.java:14: error: ';' expected
      }false{
            ^
2 errors
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(system.in);

    while(true){
      int a = sc.nextInt();
      String op = sc.nextString();
      int b = sc.nextInt();

      if(op == "?"){
        break;
      }else{
        println(a+op+b);
      }
    }
  }
}


Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(system.in);
                             ^
  symbol:   variable system
  location: class Main
Main.java:9: error: cannot find symbol
      String op = sc.nextString();
                    ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:15: error: cannot find symbol
        println(a+op+b);
        ^
  symbol:   method println(String)
  location: class Main
3 errors