Documente Academic
Documente Profesional
Documente Cultură
2、 Expression Conversion
[Problem Description]
Design a program which can tansfer an infix expression into a postfix
expression and then compute the result. Suppose the infix expression only
includes’ *’, ‘/’, ‘+’, ‘-‘, ‘(‘, ‘)’ and the numbers are all integers.
[Basic Requirements]
1) You are required to use stack.
2) The infix expression is inputted from keyboard as a string. Then the
string should be tansfered into a postfix expression which is still be
represented by string.
3) At last the postfix expression should be computed. If the expression is
wrong the program can point out.