Home > Back-end >  C: turn infix expression postfix expression and reverse polish evaluation (you can enter the decimal
C: turn infix expression postfix expression and reverse polish evaluation (you can enter the decimal

Time:10-14

[problem description] expression evaluation, the application of stack, given a "#" as the end of the formula, the results of calculation

"Input form" with "#" at the end of the expression of the operand is positive integers, each expression of a line,

[form] output output expression computing results, the output data please keep two decimal places,

[sample input]

4 + 2.53 * 3-10/5 #

3 * (7.91 -) 2 #

2.4 * 3.6/2 #

[sample output]

9.59

17.73

4.32
Mainly how to enter the decimal can also meet? Beg bosses, have been this crazy fast

CodePudding user response:

With double deposit value is ok
  • Related