Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         String infix = "3 > 4 && 4 <= 8";
  3.         System.out.printf("infix:   %s%n", infix);
  4.         System.out.printf("postfix: %s%n", transformToRPN(infix));
  5.  
  6.         test("3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3", "3 4 2 * 1 5 - 2 3 ^ ^ / + ");
  7.     }
  8.  
  9.     private static void test(String expected, String infix) {
  10.         if (expected.equals(transformToRPN(infix)))
  11.             System.out.println("test PASSED: " + infix);
  12.         else
  13.             System.out.println("test FAILED: " + infix);
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement