-->
当前位置:首页 > 题库

PROGRAMMING:Expression conversion

Luz5年前 (2021-05-10)题库521
Arithmetic expression has prefix representation, infix representation and suffix representation. Infix representation is used in daily arithmetic expression, that is, binary operator is located in the middle of two operands. Please design a program to convert infix expression to suffix expression.
###Input format:
Input infix expression without spaces in one line, which can contain '+', '-', '*', '\', and left and right brackets' () ', and the expression shall not exceed 20 characters.
###Output format:
To output the converted suffix expression in one line, different objects (operands and symbols) should be separated by spaces, but there should be no extra spaces at the end.
###Input example:
```in
2+3*(7-4)+8/4
```
###Output example:
```out
2 3 7 4 - * + 8 4 / +
```






answer:If there is no answer, please comment