Код: Выделить всё
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Input first number:");
int num1 = in.nextLine();
System.out.print("Input seccond number:");
int num2 = in.nextLine();
System.out.print("Select operator:");
char operator = in.nextLine();
if (char == '+') {
System.out.print(num1 + " + " + num2 + " = " + (num1 + num2));
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... in-vs-code