commit aa71580852c229846ee9d54478a82e6da2908590 Author: HCL <1028329274@qq.com> Date: Thu Aug 6 22:09:59 2020 +0800 Main.java diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..e4e5397 --- /dev/null +++ b/Main.java @@ -0,0 +1,32 @@ +package N; + +import java.util.List; +import java.util.Scanner; + +public class Main { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner scan = new Scanner(System.in); + int i = scan.nextInt(); + switch(i) { + case 1://计算e^x + break; + case 2://计算logax + break; + case 3://计算加减乘除 + Scanner scanner=new Scanner(System.in); + System.out.println("输入表达式:"); + String expression=scanner.next(); + Calculation calculation=new Calculation(); + List rpnList=calculation.InfixtoList(expression); + List tr=calculation.ListtoSuffix(rpnList); + int res=calculation.calculate(tr); + System.out.println(res); + break; + case 4://计算三角函数 + break; + } + } + +}