Advertisement
Samuel_Berkat_Hulu

apppp

May 9th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. /*
  2. *App
  3. *Samuel Berkat Hulu
  4. *Version 5.0 ETS Struktur Data
  5. *
  6. */
  7. import java.io.*;
  8.  
  9. class App
  10. {
  11.     public static void main(String[] args) throws IOException
  12.     {
  13.         String input, output;
  14.         while(true)
  15.         {
  16.             System.out.print("Enter infix: ");
  17.             System.out.flush();
  18.             input = getString();
  19.             if( input.equals("") )
  20.                 break;
  21.            
  22.             Ifikstopostfiks theTrans = new Ifikstopostfiks(input);
  23.             output = theTrans.doTrans();
  24.             System.out.println("Postfix is " + output + '\n');
  25.         }
  26.     }
  27.     //--------------------------------------------------------------
  28.     public static String getString() throws IOException
  29.     {
  30.         InputStreamReader isr = new InputStreamReader(System.in);
  31.         BufferedReader br = new BufferedReader(isr);
  32.         String s = br.readLine();
  33.         return s;
  34.     }
  35.     //--------------------------------------------------------------
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement