|
|
|
@ -6,6 +6,7 @@ public class Main {
|
|
|
|
|
Subtraction ss=new Subtraction();
|
|
|
|
|
Division dd=new Division();
|
|
|
|
|
MUL mm=new MUL();
|
|
|
|
|
Addition aa=new Addition();
|
|
|
|
|
System.out.println("1-加法计算 2-减法运算");
|
|
|
|
|
System.out.println("3-乘法运算 4-除法计算");
|
|
|
|
|
System.out.println("请输入选择:");
|
|
|
|
@ -14,7 +15,11 @@ public class Main {
|
|
|
|
|
System.out.println("请输入两个运算数:");
|
|
|
|
|
int a=sc.nextInt();
|
|
|
|
|
int b=sc.nextInt();
|
|
|
|
|
if(n==2) {
|
|
|
|
|
if(n==1) {
|
|
|
|
|
int c=(int) aa.add(a, b);
|
|
|
|
|
System.out.println(c);
|
|
|
|
|
}
|
|
|
|
|
else if(n==2) {
|
|
|
|
|
int c=(int) ss.sub(a, b);
|
|
|
|
|
System.out.println(c);
|
|
|
|
|
}
|
|
|
|
|