35, 15, +, 80, 70,-, *, 20, // suffix expression
(35 + 15) * (80-70)/20) = 25 // infix expression
/, *, +, 35, 15,-, 80, 70, 20 // prefix expression
The way people think is easily fixed ~~! Just as we are used to pulling 10 hexadecimal. For example
Wait for the system to be overwhelmed ~~!
The calculation method that people are used to is an infix expression. Prefix and suffix .. Confused
Actually, it's just a way of expression Sub-expression (not the way you get used)
I am here to teach you a simple conversion method that your teacher may not tell you
How to convert an infix to another sub-expression ~~
Here is an infix expression ~
A + B * C-(D + E)
Step 1: Add brackets to all calculation units based on the operator's priority ~
Formula: (A + (B * C)-(D + E ))
Step 2: Convert prefix and suffix expressions
Prefix: Move the operator number to the beginning of the corresponding brackets
It turns to pull:-(+ (A * (BC) + (de ))
Remove the parentheses:-+ A * BC + de prefix
Suffix: Move the operator number to the end of the corresponding brackets
It turns to pull: (A (BC) *) + (de) + )-
Remove the brackets: ABC * + De +-suffix sub-appearance
No. prefix and suffix do not need to be determined by brackets.
If you are used to pulling his calculation method. When computing, that is, starting from the beginning of two operands
Or find the operator later. Instead of searching in the middle, you can directly calculate the result.
You may wish to convert your form into an infix .~ From my example. You should easily find the rule to pull ~