1069: Infix to Postfix
Description
Infix ex
Write a program to convert an infix ex
Here are the only possible operators : +, -, * /, ^ (power of) and ( ) in the input string, all operant are one digit positive number.
Example input/output:
Input: "3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3"
Output: "3 4 2 * 1 5 - 2 3 ^ ^ / +"
Input: "( 1 + 2 ) * 3 - 4 / 5"
Output: "1 2 + 3 * 4 5 / -"
Input: "5 + 4 - 3 * 2 / 1"
Output: "5 4 + 3 2 * 1 / -"
Postfix ex
Input
Output
Sample Input Copy
3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3
Sample Output Copy
3 4 2 * 1 5 - 2 3 ^ ^ / +