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

import java.util.Scanner;

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

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

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


Compiler output:
Main.java:6: 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
Language: Java

import java.util.Scanner;

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

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

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


Compiler output:
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
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.next();
      int b = sc.nextInt();

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


Compiler output:
Main.java:15: error: cannot find symbol
        println(a+op+b);
        ^
  symbol:   method println(String)
  location: class Main
1 error
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.next();
      int b = sc.nextInt();

      switch(op){
        case "+" : println(a+b);
      }
    }
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
        case "+" : println(a+b);
                   ^
  symbol:   method println(int)
  location: class Main
1 error
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String args[]){


    while(true){
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      String op = sc.next();
      int b = sc.nextInt();

      if(op.equal("?"){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);
      }
    }
  }
}


Compiler output:
Main.java:13: error: ')' expected
      if(op.equal("?"){break;}
                      ^
1 error
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String args[]){


    while(true){
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      String op = sc.next();
      int b = sc.nextInt();

      if(op.equals("?"){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);
      }
    }
  }
}


Compiler output:
Main.java:13: error: ')' expected
      if(op.equals("?"){break;}
                       ^
1 error
Language: Java

import java.util.*;

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

        while(true){
            int x = sc.nextInt();
            String op = sc.next();
            int y = sc.nextInt();

            if(op.equals("+")){
                System.out.println(x + y);
            }else if(op.equals("-")){
                System.out.println(x - y);
            }else if(op.equals("*")){
                System.out.println(x * y);
            }else if(op.equals("/")){
                System.out.println(x / y);
            }else if("?"){
                break;              
            }
        }
    }
}


Compiler output:
Main.java:20: error: incompatible types: String cannot be converted to boolean
            }else if("?"){
                     ^
1 error
Language: Java

//import java.io.*;
import java.util.Scanner;

public class Calc3{
    public static void main(String[] args){
        int a,b;
        String op;
        boolean isEnd=true;
        //char op;
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        try{
            while(isEnd)
            {
                Scanner sc = new Scanner(System.in);
                a=sc.nextInt();
                op=sc.next();
                b=sc.nextInt();

            /* line=reader.readLine();
            a=Integer.parseInt(line);

            op=String.parseString(line);

           // line=reader.readLine();
            b=Integer.parseInt(line); */

                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 "?":
                        isEnd=false;
                        break;
                    default:
                        break;
                }
            }
            

        }catch(NumberFormatException e){
            System.out.println(e);
        /* }catch(UTILLException e){
            System.out.println(e); */
        }
    }
}


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

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int i,count=0,a,b;
        char c;
        for(i=0; ;i++){
            if(count%3==0){
                a=sc.nextInt();
            }else if(count%3==2){
                b=sc.nextInt();
            }else{
                c=sc.next();
            }
            
            if(c=="+"){
                System.out.println(a+b);
            }else if(c=="-"){
                System.out.println(a-b);
            }else if(c=="*"){
                System.out.println(a*b);
            }else if(c=="/"){
                System.out.println(a/b);
            }else{
                break;
            }
            count++;
        }
    System.out.println();
    }
}


Compiler output:
Main.java:13: error: incompatible types: String cannot be converted to char
                c=sc.next();
                         ^
Main.java:16: error: bad operand types for binary operator '=='
            if(c=="+"){
                ^
  first type:  char
  second type: String
Main.java:18: error: bad operand types for binary operator '=='
            }else if(c=="-"){
                      ^
  first type:  char
  second type: String
Main.java:20: error: bad operand types for binary operator '=='
            }else if(c=="*"){
                      ^
  first type:  char
  second type: String
Main.java:22: error: bad operand types for binary operator '=='
            }else if(c=="/"){
                      ^
  first type:  char
  second type: String
5 errors
Language: Java

import java.util.Scanner;

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

        for(int i = 0; i < 20_000; i++){
            int a = scanner.nextInt();
            String op = scanner.next();
            int b = scanner.nextInt();

            if(op.equals("?"){
                break;
            }else if(op.equals("+")){
                System.out.println(a+b);
            }else if(op.equals("-")){
                System.out.println(a-b);
            }else if(op.equals("*")){
                System.out.println(a*b);
            }else if(op.equals("/")){
                System.out.println(a/b);
            }
        }
        scanner.close();
    }
}


Compiler output:
Main.java:12: error: ')' expected
            if(op.equals("?"){
                             ^
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,b;
		char op;
		int d;
		
		while(){
		    a = sc.nextInt();
		    op = sc.next();
		    b = sc.nextInt();
		    
		    if(op == '+'){
		        d = a+b;
		    }
		    else if(op == '-'){
		        d = a-b;
		    }
		    else if(op == '*'){
		        d = a*b;
		    }
		    else if(op == '/'){
		        d = a/b;
		    }
		    else{
		        sc.close();
		        return;
		    }
		    System.out.println(d);
		    
		}
	}

}


Compiler output:
Main.java:11: error: illegal start of expression
		while(){
		      ^
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,b;
		char op;
		int d;
		
		while(0){
		    a = sc.nextInt();
		    op = sc.next();
		    b = sc.nextInt();
		    
		    if(op == '+'){
		        d = a+b;
		    }
		    else if(op == '-'){
		        d = a-b;
		    }
		    else if(op == '*'){
		        d = a*b;
		    }
		    else if(op == '/'){
		        d = a/b;
		    }
		    else{
		        sc.close();
		        return;
		    }
		    System.out.println(d);
		    
		}
	}

}


Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to boolean
		while(0){
		      ^
Main.java:13: error: incompatible types: String cannot be converted to char
		    op = sc.next();
		                ^
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,b;
		char op;
		int d;
		
		while(true){
		    a = sc.nextInt();
		    op = sc.next();
		    b = sc.nextInt();
		    
		    if(op == '+'){
		        d = a+b;
		    }
		    else if(op == '-'){
		        d = a-b;
		    }
		    else if(op == '*'){
		        d = a*b;
		    }
		    else if(op == '/'){
		        d = a/b;
		    }
		    else{
		        sc.close();
		        return;
		    }
		    System.out.println(d);
		    
		}
	}

}


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

import java.util.Scanner;
public class s2 {
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        while(true) {
            int a = sc.nextInt();
            String b  = sc.next();
            int c = sc.nextInt();
            int f=0;
            switch (b) {
    		case "+":
    			System.out.println(a+c);
    			break;
    		case "-":
    			System.out.println(a-c);
    			break;
    		case "*":
    			System.out.println(a*c);
    			break;
    		case "/":
    			System.out.println(a/c);
    			break;
    		default:
    			f=1;
    			break;
            }
            if(f==1)break;
            sc.close();
        }
    }
}



Compiler output:
Main.java:2: error: class s2 is public, should be declared in a file named s2.java
public class s2 {
       ^
1 error
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();
		     String OP = sc.next();
		     int b=sc.nextInt();
		     
		     if(OP.equals("?"))break;
		     if(OP.equals("+"));
		        System.out.println(a+b);
	         } else if (OP.equals("-"));{
	        	 System.out.println(a-b);
	         }else if(OP.equals("*"));{
	        	 System.out.println(a*b);
	         }else if(OP.equals("/"));{
	        	 System.out.println(a/b);
	         }
}
	 		
	 		 
	         sc.close();
}
}



Compiler output:
Main.java:14: error: 'else' without 'if'
	         } else if (OP.equals("-"));{
	           ^
Main.java:16: error: 'else' without 'if'
	         }else if(OP.equals("*"));{
	          ^
Main.java:18: error: 'else' without 'if'
	         }else if(OP.equals("/"));{
	          ^
Main.java:24: error: <identifier> expected
	         sc.close();
	                 ^
Main.java:26: error: class, interface, enum, or record expected
}
^
5 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while(True){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


Compiler output:
Main.java:15: error: not a statement
    System,out.println(a-b);
    ^
Main.java:15: error: ';' expected
    System,out.println(a-b);
          ^
Main.java:17: error: not a statement
    System,out.println(a*b);
    ^
Main.java:17: error: ';' expected
    System,out.println(a*b);
          ^
Main.java:16: error: 'else' without 'if'
   else if(op=='*')
   ^
Main.java:18: error: 'else' without 'if'
   else if(op=='/')
   ^
6 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while(True){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


Compiler output:
Main.java:15: error: not a statement
    System,out.println((a-b));
    ^
Main.java:15: error: ';' expected
    System,out.println((a-b));
          ^
Main.java:17: error: not a statement
    System,out.println((a*b));
    ^
Main.java:17: error: ';' expected
    System,out.println((a*b));
          ^
Main.java:16: error: 'else' without 'if'
   else if(op=='*')
   ^
Main.java:18: error: 'else' without 'if'
   else if(op=='/')
   ^
6 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while(True){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


Compiler output:
Main.java:8: error: cannot find symbol
  while(True){
        ^
  symbol:   variable True
  location: class main
Main.java:10: error: incompatible types: String cannot be converted to char
   op=sc.next();
             ^
2 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while (True){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


Compiler output:
Main.java:8: error: cannot find symbol
  while (True){
         ^
  symbol:   variable True
  location: class main
Main.java:10: error: incompatible types: String cannot be converted to char
   op=sc.next();
             ^
2 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while(true){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


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

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  String op;
  Scanner sc= new Scanner(System.in);
  while(true){
   a=sc.nextInt();
   op=sc.next();
   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=='?')
    break;}
 }
}


Compiler output:
Main.java:12: error: bad operand types for binary operator '=='
   if(op=='+')
        ^
  first type:  String
  second type: char
Main.java:14: error: bad operand types for binary operator '=='
   else if(op=='-')
             ^
  first type:  String
  second type: char
Main.java:16: error: bad operand types for binary operator '=='
   else if(op=='*')
             ^
  first type:  String
  second type: char
Main.java:18: error: bad operand types for binary operator '=='
   else if(op=='/')
             ^
  first type:  String
  second type: char
Main.java:20: error: bad operand types for binary operator '=='
   else if(op=='?')
             ^
  first type:  String
  second type: char
5 errors
Language: Java

import java.io.*;
import java.util.Scanner;
class main{
 public static void main(String[] args){
  int a,b;
  char op;
  Scanner sc= new Scanner(System.in);
  while(true){
   a=sc.nextInt();
   op=sc.nextChar();
   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=='?')
    break;}
 }
}


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

import java.util.Scanner;

public class Ex03SimpleCalculator {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a;
		int b;
		String op;
		int count;
		int[] num = new int[20000];
		top: for (count = 0; true; count++) {
			a = sc.nextInt();
			op = sc.next();
			b = sc.nextInt();
			switch (op) {
			case "+":
				num[count] = a + b;
				break;
			case "-":
				num[count] = a - b;
				break;
			case "*":
				num[count] = a * b;
				break;
			case "/":
				num[count] = a / b;
				break;
			case "?":
				break top;
			}
		}
		for (int i = 0; i < count; i++) {
			System.out.println(num[i]);
		}
		sc.close();
	}
}


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

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

public class ITP1_4_C {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<Integer> result = new ArrayList<Integer>();
		String[] n;

		while (true) {

			String line = sc.nextLine();
			n = line.split(" ");

			if (n[1].equals("?")) {
				break;
			}

			int a = Integer.parseInt(n[0]);
			int b = Integer.parseInt(n[2]);
			if (n[1].equals("+")) {
				result.add(a + b);
			} else if (n[1].equals("-")) {
				result.add(a - b);
			} else if (n[1].equals("*")) {
				result.add(a * b);
			} else if (n[1].equals("/")) {
				result.add(a / b);

			}

		}// whileここまで
		for (Integer i : result) {
			System.out.println(i);

		}

	}

}



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

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

public class main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<Integer> result = new ArrayList<Integer>();
		String[] n;

		while (true) {

			String line = sc.nextLine();
			n = line.split(" ");

			if (n[1].equals("?")) {
				break;
			}

			int a = Integer.parseInt(n[0]);
			int b = Integer.parseInt(n[2]);
			if (n[1].equals("+")) {
				result.add(a + b);
			} else if (n[1].equals("-")) {
				result.add(a - b);
			} else if (n[1].equals("*")) {
				result.add(a * b);
			} else if (n[1].equals("/")) {
				result.add(a / b);

			}

		}// whileここまで
		for (Integer i : result) {
			System.out.println(i);

		}

	}

}



Compiler output:
Main.java:5: 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;

class Main{private static string
    
  public static void main(String[] args){
    
    Scanner s= new Scanner(System.in);
while(true){
int a=s.nextInt();
 num = s.next();
int b=s.nextInt();

if(num.equals("?")){
    
    break;
}

switch(num){
    
    case "+":
        System.out.printf(a+b);
        break;
         case "-":
        System.out.printf(a-b);
        break;
            case "*":
        System.out.printf(a*b);
        break;
            case "/":
        System.out.printf(a/b);
        break;
    
    
    
}
    
}
}
}


Compiler output:
Main.java:3: error: <identifier> expected
class Main{private static string
                                ^
1 error
Language: Java

import java.util.Scanner;

class Main{
private static string num;
    
  public static void main(String[] args){
    
    Scanner s= new Scanner(System.in);
while(true){
int a=s.nextInt();
 num = s.next();
int b=s.nextInt();

if(num.equals("?")){
    
    break;
}

switch(num){
    
    case "+":
        System.out.printf(a+b);
        break;
         case "-":
        System.out.printf(a-b);
        break;
            case "*":
        System.out.printf(a*b);
        break;
            case "/":
        System.out.printf(a/b);
        break;
    
    
    
}
    
}
}
}


Compiler output:
Main.java:4: error: cannot find symbol
private static string num;
               ^
  symbol:   class string
  location: class Main
Main.java:22: error: no suitable method found for printf(int)
        System.out.printf(a+b);
                  ^
    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)
Main.java:25: error: no suitable method found for printf(int)
        System.out.printf(a-b);
                  ^
    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)
Main.java:28: error: no suitable method found for printf(int)
        System.out.printf(a*b);
                  ^
    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)
Main.java:31: error: no suitable method found for printf(int)
        System.out.printf(a/b);
                  ^
    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)
5 errors
Language: Java

import java.util.Scanner;

class Main{
private static String num;
    
  public static void main(String[] args){
    
    Scanner s= new Scanner(System.in);
while(true){
int a=s.nextInt();
 num = s.next();
int b=s.nextInt();

if(num.equals("?")){
    
    break;
}

switch(num){
    
    case "+":
        System.out.printf(a+b);
        break;
         case "-":
        System.out.printf(a-b);
        break;
            case "*":
        System.out.printf(a*b);
        break;
            case "/":
        System.out.printf(a/b);
        break;
    
    
    
}
    
}
}
}


Compiler output:
Main.java:22: error: no suitable method found for printf(int)
        System.out.printf(a+b);
                  ^
    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)
Main.java:25: error: no suitable method found for printf(int)
        System.out.printf(a-b);
                  ^
    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)
Main.java:28: error: no suitable method found for printf(int)
        System.out.printf(a*b);
                  ^
    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)
Main.java:31: error: no suitable method found for printf(int)
        System.out.printf(a/b);
                  ^
    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)
4 errors
Language: Java

import java.util.Scanner;

class Main{
private static String num;
    
  public static void main(String[] args){
    
    Scanner s= new Scanner(System.in);
while(true){
int a=s.nextInt();
 num = s.next();
int b=s.nextInt();

if(num.equals("?")){
    
    break;
}

switch(num){
    
    case "+":
        System.out.printf(a+b);
        break;
    case "-":
        System.out.printf(a-b);
        break;
    case "*":
        System.out.printf(a*b);
        break;
    case "/":
        System.out.printf(a/b);
        break;
    
    
    
}
    
}
}
}


Compiler output:
Main.java:22: error: no suitable method found for printf(int)
        System.out.printf(a+b);
                  ^
    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)
Main.java:25: error: no suitable method found for printf(int)
        System.out.printf(a-b);
                  ^
    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)
Main.java:28: error: no suitable method found for printf(int)
        System.out.printf(a*b);
                  ^
    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)
Main.java:31: error: no suitable method found for printf(int)
        System.out.printf(a/b);
                  ^
    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)
4 errors
Language: Java

import java.util.Scanner;

class Main{
private static String num;
private static int a,b;
    
  public static void main(String[] args){
    
    Scanner s= new Scanner(System.in);
while(true){
 a=s.nextInt();
 num = s.next();
b=s.nextInt();

if(num.equals("?")){
    
    break;
}

switch(num){
    
    case "+":
        System.out.printf(a+b);
        break;
    case "-":
        System.out.printf(a-b);
        break;
    case "*":
        System.out.printf(a*b);
        break;
    case "/":
        System.out.printf(a/b);
        break;
    
    
    
}
    
}
}
}


Compiler output:
Main.java:23: error: no suitable method found for printf(int)
        System.out.printf(a+b);
                  ^
    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)
Main.java:26: error: no suitable method found for printf(int)
        System.out.printf(a-b);
                  ^
    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)
Main.java:29: error: no suitable method found for printf(int)
        System.out.printf(a*b);
                  ^
    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)
Main.java:32: error: no suitable method found for printf(int)
        System.out.printf(a/b);
                  ^
    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)
4 errors
Language: Java

package Computation;

import java.util.Scanner;

public class simple_calculator {

	public static void main(String[] args){
		
		//
		Scanner sc = new Scanner(System.in);
		String out = "";
		
		int a = sc.nextInt();
		Object operator = "/";
		int b = sc.nextInt();
		
		Object object ="/";
		//
		switch(true){
			case(operator.equals("?")):
				break;	
			
			case()
			
		}	
	}
}

Compiler output:
Main.java:23: error: illegal start of type
			case()
			    ^
Main.java:23: error: : or -> expected
			case()
			      ^
2 errors
Language: Java

import java.util.Scanner;

public class simple_calculator {

	public static void main(String[] args) {

		//
		Scanner sc = new Scanner(System.in);
		String out = "";

		// 演算子の変数に入っている中身で場合わけ
		while (true) {
			
			int a = sc.nextInt();
			String operator = sc.next();
			int b = sc.nextInt();
			
			if (operator.equals("?")) {
				break;
			}
			switch (operator) {

			case ("/"):
				out = out + a / b + "\n";
				break;

			case ("*"):
				out = out + a * b + "\n";
				break;

			case ("+"):
				out = out + (a + b) + "\n";
				break;

			case ("-"):
				out = out + (a - b) + "\n";
				break;
			}
		}
		// 出力
		System.out.println(out);
	}
}

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


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

int main()
{
	int a, b, x;
	char buf[256], *p;
	char op;

	for (;;) {
		gets(buf);

		p = buf;
		a = atoi(p);
		while (isspace(*p)) p++;
		while (isdigit(*p)) p++;
		while (isspace(*p)) p++;
		op = *p++;
		b = atoi(p);

		if      (op == '+') x = a + b;
		else if (op == '-') x = a - b;
		else if (op == '*') x = a * b;
		else if (op == '/') x = a / b;
		else break;
		printf("%d\n", x);
	}
	return 0;
}





Compiler output:
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   13 |                 gets(buf);
      |                 ^~~~
      |                 fgets
Language: C

#include<stdio.h>
#define pai 3.141592653589
int main(){
	int a, b, , op, ans;
	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.c: In function 'main':
main.c:4:19: error: expected identifier or '(' before ',' token
    4 |         int a, b, , op, ans;
      |                   ^
main.c:6:40: error: 'op' undeclared (first use in this function)
    6 |                 scanf("%d %c %d", &a, &op, &b);
      |                                        ^~
main.c:6:40: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main()
{
	int a, b, x;
	char buf[256], *p;
	char op;

	for (;;) {
		gets(buf);

		p = buf;
		a = atoi(p);
		while (isspace(*p)) p++;
		while (isdigit(*p)) p++;
		while (isspace(*p)) p++;
		op = *p++;
		b = atoi(p);

		if      (op == '+') x = a + b;
		else if (op == '-') x = a - b;
		else if (op == '*') x = a * b;
		else if (op == '/') x = a / b;
		else break;
		printf("%d\n", x);
	}
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:12:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   12 |                 gets(buf);
      |                 ^~~~
      |                 fgets
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:5:17: error: implicit declaration of function 'scanf_s' [-Wimplicit-function-declaration]
    5 |                 scanf_s("%d %c %d",&a, &op,1 ,&b);
      |                 ^~~~~~~
main.c:11:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |                         printf("%d\n", a + b);
      |                         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:11:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |                         printf("%d\n", a + b);
      |                         ^~~~~~
main.c:11:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   14 |                         printf("%d\n", a - b);
      |                         ^~~~~~
main.c:14:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |                         printf("%d\n", a * b);
      |                         ^~~~~~
main.c:17:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |                         printf("%d\n", a / b);
      |                         ^~~~~~
main.c:20:25: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main()
{
	int a[1000], b[1000], i, ans[1000];
	char op;

	for(i=0;i<1000;i++){
		scanf("%d", &a[i]);
		scanf("%c", &op);
		scanf("%d", &b[i]);
	
		switch(op){
			case + : ans[i] = a[i] + b[i];
			case - : ans[i] = a[i] - b[i];
			case * : ans[i] = a[i] * b[i];
			case ; : ans[i] = a[i] / b[i];
			case ? : break;
		}

		printf("%d¥n", ans[i]);
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:32: error: expected expression before ':' token
   14 |                         case + : ans[i] = a[i] + b[i];
      |                                ^
main.c:15:32: error: expected expression before ':' token
   15 |                         case - : ans[i] = a[i] - b[i];
      |                                ^
main.c:16:32: error: expected expression before ':' token
   16 |                         case * : ans[i] = a[i] * b[i];
      |                                ^
main.c:17:30: error: expected expression before ';' token
   17 |                         case ; : ans[i] = a[i] / b[i];
      |                              ^
main.c:17:32: error: expected expression before ':' token
   17 |                         case ; : ans[i] = a[i] / b[i];
      |                                ^
main.c:18:30: error: expected expression before '?' token
   18 |                         case ? : break;
      |                              ^
Language: C

#include <stdio.h>

enum calc{
	+,
	-,
	*,
	/,
	?
};

int main()
{
	int a[1000], b[1000], i, ans[1000];
	enum calc op;


	for(i=0;i<1000;i++){
		scanf("%d", &a[i]);
		scanf("%c", &op);
		scanf("%d", &b[i]);

		if(b[i]==0){
			break;
		}
	
		switch(op){
			case + : ans[i] = a[i] + b[i];
			case - : ans[i] = a[i] - b[i];
			case * : ans[i] = a[i] * b[i];
			case / : ans[i] = a[i] / b[i];
			case ? : break;
			default : break;
		}

		printf("%d¥n", ans[i]);
	}

	return 0;
}


Compiler output:
main.c:4:9: error: expected identifier before '+' token
    4 |         +,
      |         ^
main.c: In function 'main':
main.c:27:32: error: expected expression before ':' token
   27 |                         case + : ans[i] = a[i] + b[i];
      |                                ^
main.c:28:32: error: expected expression before ':' token
   28 |                         case - : ans[i] = a[i] - b[i];
      |                                ^
main.c:29:32: error: expected expression before ':' token
   29 |                         case * : ans[i] = a[i] * b[i];
      |                                ^
main.c:30:30: error: expected expression before '/' token
   30 |                         case / : ans[i] = a[i] / b[i];
      |                              ^
main.c:30:30: error: expected expression before '/' token
main.c:31:30: error: expected expression before '?' token
   31 |                         case ? : break;
      |                              ^
Language: C

#include<atdio.h>

int main(){
    int a,b,i,op,x[10000];
    for(i=0;;i++){
         scnaf(%d%c%d",&a,&op,&b);
         if(op=='?')break;
         if(op=='+')x[i]=a+b;
         if(op=='-')x[i]=a-b;
         if(op=='*')x[i]=a*b;
         if(op=='/')x[i]=a/b;
         }
   for(i=0;;i++){
         if(x[i]==\)break;
         printf("%d\n",&x[i]);
         }


Compiler output:
main.c:1:9: fatal error: atdio.h: No such file or directory
    1 | #include<atdio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main(){
    int a,b,i,op,x[10000];
    for(i=0;;i++){
         scnaf(%d%c%d",&a,&op,&b);
         if(op=='?')break;
         if(op=='+')x[i]=a+b;
         if(op=='-')x[i]=a-b;
         if(op=='*')x[i]=a*b;
         if(op=='/')x[i]=a/b;
         }
   for(i=0;;i++){
         if(x[i]==\)break;
         printf("%d\n",&x[i]);
         }


Compiler output:
main.c: In function 'main':
main.c:6:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |          scnaf(%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
main.c:6:16: error: expected expression before '%' token
    6 |          scnaf(%d%c%d",&a,&op,&b);
      |                ^
main.c:6:22: warning: missing terminating " character
    6 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^
main.c:6:22: error: missing terminating " character
    6 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^~~~~~~~~~~~~
main.c:11:30: error: expected ';' before '}' token
   11 |          if(op=='/')x[i]=a/b;
      |                              ^
      |                              ;
   12 |          }
      |          ~                    
main.c:14:19: error: stray '\' in program
   14 |          if(x[i]==\)break;
      |                   ^
main.c:14:20: error: expected expression before ')' token
   14 |          if(x[i]==\)break;
      |                    ^
main.c:16:10: error: expected declaration or statement at end of input
   16 |          }
      |          ^
Language: C

#include<stdio.h>

int main(){
    int a,b,i,x[10000];
    char op;
    for(i=0;;i++){
         scnaf(%d%c%d",&a,&op,&b);
         if(op=='?')break;
         if(op=='+')x[i]=a+b;
         if(op=='-')x[i]=a-b;
         if(op=='*')x[i]=a*b;
         if(op=='/')x[i]=a/b;
         }
   for(i=0;;i++){
         if(x[i]==\)break;
         printf("%d\n",&x[i]);
         }


Compiler output:
main.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
main.c:7:16: error: expected expression before '%' token
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                ^
main.c:7:22: warning: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^
main.c:7:22: error: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^~~~~~~~~~~~~
main.c:12:30: error: expected ';' before '}' token
   12 |          if(op=='/')x[i]=a/b;
      |                              ^
      |                              ;
   13 |          }
      |          ~                    
main.c:15:19: error: stray '\' in program
   15 |          if(x[i]==\)break;
      |                   ^
main.c:15:20: error: expected expression before ')' token
   15 |          if(x[i]==\)break;
      |                    ^
main.c:17:10: error: expected declaration or statement at end of input
   17 |          }
      |          ^
Language: C

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
main.c:7:16: error: expected expression before '%' token
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                ^
main.c:7:22: warning: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^
main.c:7:22: error: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^~~~~~~~~~~~~
main.c:12:40: error: expected ';' before '}' token
   12 |          if(op=='/')printf("%d\n",a/b);
      |                                        ^
      |                                        ;
   13 |          }
      |          ~
Language: C

#include<stdio.h>

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



Compiler output:
main.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
main.c:7:16: error: expected expression before '%' token
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                ^
main.c:7:22: warning: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^
main.c:7:22: error: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^~~~~~~~~~~~~
main.c:12:42: error: expected ';' before '}' token
   12 |          if(op=='/'){printf("%d\n",a/b);}
      |                                          ^
      |                                          ;
   13 |          }
      |          ~
Language: C

#include<stdio.h>

int main(){
    int a,b,i;
    char op;
    for(i=0;;i++){
         scnaf(%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.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
main.c:7:16: error: expected expression before '%' token
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                ^
main.c:7:22: warning: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^
main.c:7:22: error: missing terminating " character
    7 |          scnaf(%d%c%d",&a,&op,&b);
      |                      ^~~~~~~~~~~~~
main.c:12:47: error: expected ';' before '}' token
   12 |          else if(op=='/'){printf("%d\n",a/b);}
      |                                               ^
      |                                               ;
   13 |          }
      |          ~
Language: C

#include<stdio.h>

int main(){
    int a,b,i;
    char op;
    for(i=0;;i++){
         scnaf("%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.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf("%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
Language: C

#include<stdio.h>

int main(){
    int a,b,i;
    char op;
    for(i=1;;i++){
         scnaf("%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.c: In function 'main':
main.c:7:10: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |          scnaf("%d%c%d",&a,&op,&b);
      |          ^~~~~
      |          scanf
Language: C

#include<stdio.h>
int main(){
int a,b,i;
char op;
    for(i=1;i++){
        scanf("%d %c %d",&a,&op,&b);
        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);
        }else if(op=='?') {
            break;
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:16: error: expected ';' before ')' token
    5 |     for(i=1;i++){
      |                ^
      |                ;