master
aikang 4 years ago
parent 99f3e86ddb
commit 6f1dee1626

@ -0,0 +1,26 @@
package small_computer;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Subtraction ss=new Subtraction();
Division dd=new Division();
System.out.println("1-加法计算 2-减法运算");
System.out.println("3-乘法运算 4-除法计算");
System.out.println("请输入选择:");
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
System.out.println("请输入两个运算数:");
int a=sc.nextInt();
int b=sc.nextInt();
if(n==2) {
int c=(int) ss.sub(a, b);
System.out.println(c);
}
else if(n==4) {
int c=(int) dd.div(a, b);
System.out.println(c);
}
}
}
Loading…
Cancel
Save