Krolyxon
Commit 2a9918f

Branches

Refs →

jcalCalculator.java

8 lines · 268 B · Java

1public class Calculator {
2 public static void main(String[] args) {
3 String expr = "(84 / 4 * 3 - 9) * 2 + 1 / 5"; // 108.2
4 Parser p = new Parser(expr);
5 String postfix = p.toPostFix();
6 System.out.println(p.evalExpr(postfix));
7 }
8}