import java.util.Scanner;
public class Test4 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入一个数字:");
while (scanner.hasNextDouble()) {
double e = scanner.nextDouble();
System.out.println("请再输入一个数字:");
double f = scanner.nextDouble();
System.out.println("请选择算法 加 减 乘 除:");
String k = scanner.next();
switch ( k) {
case "+":
System.out.println((e + f));
break;
case "-":
System.out.println((e - f));
break;
case "*":
System.out.println((e * f));
break;
case "/":
System.out.println((e / f));
break;
default:
System.out.println("请输入正确的算法符号");
}
}
scanner.close();
}
}