后缀表达式转中缀表达式方法:在式子中找(算子 算子 运算符)的结构,转化为中缀,然后作为算子带入下一式子中
例题:A B C D E A - + * / + F E - + (A == 7 B == 9 C == 3 D == 4 E == 6 F == 8)
E A - == (E - A)
F E - == (F - E)
原式 == A B C D (E- A) + * / +(F- E) +
D (E - A) + == (D + (E - A))
C (D + (E - A)) * == (C * (D + (E - A)))
B (C * (D + (E - A))) / == (B / (C * (D + (E - A))))
A (B / (C * (D + (E - A)))) + == (A + (B / (C * (D + (E - A)))))
原式 == (A + (B / (C * (D + (E - A))))) + (F - E)
== (7 + (9 / (3 * (4 + (6 - 7))))) + (8 - 6)
== (7 + (9 / (3 * (4 + (-1))))) + 2
== (7 + (9 / (3 * 3))) + 2
== (7 + (9 / 9)) + 2
== 8 + 2
== 10