package Demo3;
import java.util.Scanner;
public class Arithmetic {
public static void main(String[] args) {
System.out.println("欢迎使用迷你计算器\n");
String answer="";//控制循环
do{
double sum=0.0;
Scanner input=new Scanner(System.in);
System.out.println("请输入第一个操作数:");
int num1=input.nextInt();
System.out.println("请输入运算符:(+、-、*、/):");//运算符是String类型
String oper=input.next();//int oper=input.nextInt();
System.out.println("请输入第二个操作数:");
int num3=input.nextInt();
int result=0;//运算结果
if("+".equals(oper)){
result=num1+num3;
}else if("-".equals(oper)){
result=num1-num3;
}else if("*".equals(oper)){
result=num1*num3;
}else if("/".equals(oper)){
result=num1/num3;
}
//switch语句的写法
/*switch(oper){
case "+":
sum=num1+num3;
break;
case 2