commit
aa71580852
@ -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<String> rpnList=calculation.InfixtoList(expression);
|
||||
List<String> tr=calculation.ListtoSuffix(rpnList);
|
||||
int res=calculation.calculate(tr);
|
||||
System.out.println(res);
|
||||
break;
|
||||
case 4://计算三角函数
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue