资 源 简 介
题目:设计一个题目,演示用算符优先法对算术表达式求值的过程。
概要设计
1、顺序扫描中缀算术表达式,当读到数字时直接将其送至输出队列中;
2、当读到运算符时,将栈中所有优先级高于或等于该运算符弹出,送至输出队列中,再将当前运算符入栈;
3、当读入左括号时,即入栈;
4、当读到右括号时,将靠近栈顶的第一个左括号上面的运算符全部一次弹出,送至输出队列中,再删除栈中的左括号。
5、使用VS栈来存储读入的操作和运算结果,然后进行数字字符到数值的转换。
-Title: Design of a topic, presentation operator priority method with arithmetic expression evaluation process. Summary of design 1, the order of scanning arithmetic infix expressions, when they read numbers directly to the output queue 2, when they read operator, it will stack all priority higher than or equal to the operator pop-up , sent to the output queue, and then the current operator入栈 3, when read left brackets, that is, when入栈 4, when they read the right brackets, it will be near the Top-left of the first operator in brackets above All a pop-up, sent to the output queue, and then delete stacks of left brackets. 5, the use of VS stack to store read operation and computing the results of numeric characters and then proceed to the numerical co