afiqakraam

appintopost

Apr 25th, 2021
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. class App
  4. {
  5.     public static void main(String[] args) throws IOException
  6.     {
  7.         String input, output;
  8.         while(true)
  9.         {
  10.             System.out.print("Infix: ");
  11.             System.out.flush();
  12.             input = getString();
  13.             if( input.equals("") )
  14.                 break;
  15.             InToPost theTrans = new InToPost(input);
  16.             output = theTrans.doTrans();
  17.             System.out.println("Postfix = " + output + '\n');
  18.         }
  19.     }
  20.     public static String getString() throws IOException
  21.     {
  22.         InputStreamReader isr = new InputStreamReader(System.in);
  23.         BufferedReader br = new BufferedReader(isr);
  24.         String s = br.readLine();
  25.         return s;
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment