import java.util.Scanner;
public class Sizeyunsuan {
public static void main(String[]args){
Scanner in=new Scanner(System.in
);
System.out.println("请输入两个数字:");
int num1=in.nextInt();
int num2=in.nextInt();
System.out.println("请选择你要的方法:1(加法)2(减法)3(乘法)4(除法)");
float y = 0;
int x=in.nextInt();
switch(x){
case 1:y=num1+num2;break;
case 2:y=num1-num2;break;
case 3:y=num1*num2;break;
case 4:y=num1/num2;break;
}
System.out.println("结果为:"+y);
}
}
public class Sizeyunsuan {
public static void main(String[]args){
Scanner in=new Scanner(System.in
);
System.out.println("请输入两个数字:");
int num1=in.nextInt();
int num2=in.nextInt();
System.out.println("请选择你要的方法:1(加法)2(减法)3(乘法)4(除法)");
float y = 0;
int x=in.nextInt();
switch(x){
case 1:y=num1+num2;break;
case 2:y=num1-num2;break;
case 3:y=num1*num2;break;
case 4:y=num1/num2;break;
}
System.out.println("结果为:"+y);
}
}