Guest User

Main

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