题解 | #四则运算#
四则运算
http://www.nowcoder.com/practice/9999764a61484d819056f807d2a91f1e
import java.util.*;
import javax.script.*;
public class Main{
public static void main(String[] args) throws ScriptException {
Scanner scan = new Scanner(System.in);
String input = scan.nextLine();
input = input.replace("[","(");
input = input.replace("{","(");
input = input.replace("}",")");
input = input.replace("]",")");
ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("nashorn");
System.out.println(scriptEngine.eval(input));
}
}