Compare commits
No commits in common. 'master' and 'dev1' have entirely different histories.
@ -0,0 +1,36 @@
|
||||
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
|
||||
A.main(args);
|
||||
break;
|
||||
case 2://计算logax
|
||||
B b = new B();
|
||||
B.main(args);
|
||||
break;
|
||||
case 3://计算加减乘除
|
||||
Scanner scanner=new Scanner(System.in);
|
||||
System.out.println("输入表达式:");
|
||||
String expression=scanner.next();
|
||||
Calculation calculation=new Calculation();
|
||||
List<String> rpnList=calculation.InfixtoList(expression);
|
||||
List<String> tr=calculation.ListtoSuffix(rpnList);
|
||||
int res=calculation.calculate(tr);
|
||||
System.out.println(res);
|
||||
break;
|
||||
case 4://计算三角函数
|
||||
D.main(args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue