Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- class Main {
- public static void main(String[] args) throws IOException{
- String input, output;
- while(true){
- System.out.print("Enter infix: ");
- System.out.flush();
- input = getString();
- if( input.equals(""))
- break;
- ToPostfix theTrans = new ToPostfix(input);
- output = theTrans.trabslation();
- System.out.println("Postfix is " + output + '\n');
- }
- }
- public static String getString() throws IOException{
- InputStreamReader isr = new InputStreamReader(System.in);
- BufferedReader br = new BufferedReader(isr);
- String s = br.readLine();
- return s;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment