Description: 中缀表达式求值,从键盘输入一个表达式,输出表达式结果-Infix expression evaluation, an expression from the keyboard input, the output expression of the results Platform: |
Size: 1024 |
Author:李无 |
Hits:
Description: 表达式求值
用户按平时习惯输入数字算术表达式(即中缀表达式)后,输出对应的后缀表达式,并求出表达式的值。可借此熟悉栈的操作。
可供学习《数据结构》(清华大学出版社)(P52表达式求值)、《数据结构课程设计》(机械工业出版社)(P37表达式求值问题)时参考,本程序优于书中算法,并支持浮点型-Expression evaluated by the usual habits of the user input the number of arithmetic expressions (ie infix expressions), the output of the corresponding suffix expression, and calculated the value of expression. Will be able to familiar with the stack operation. For learning data structure (Tsinghua University Press) (P52 expression evaluation), Data Structure Course Design (Mechanical Industry Press) (P37 expression evaluation problem) reference, this procedure is superior to the book algorithm, and to support the floating-point type Platform: |
Size: 1024 |
Author:XY Z |
Hits:
Description: 进行包括字母、数字在内的表达式的前缀-中缀等转换及表达式的求值-Including letters, numbers, including the prefix expressions- such as conversion and infix expression evaluation Platform: |
Size: 2048 |
Author:szl |
Hits:
Description: 题目:设计一个题目,演示用算符优先法对算术表达式求值的过程。
概要设计
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 conversion. Platform: |
Size: 6144 |
Author:布瓜 |
Hits:
Description: 自己写的一个24点小游戏,其中用栈实现了中缀和后缀表达式求值,可以加以借鉴-Himself wrote a 24-point game, which used a stack infix and suffix expression evaluation can be draw Platform: |
Size: 2048 |
Author:xuan_lengyue |
Hits:
Description: 中缀表达式转化成后缀表达式并求值的算法,将中缀表达式转换为后缀表达式,顺利转换返回true,若转换过程中发现中缀表达式非法则返回false-Infix suffix expressions into expressions and evaluation algorithms, will be converted to infix expressions suffix expression, a smooth transition to return to true, if the conversion process is made up of expression found in illicit returns false Platform: |
Size: 2048 |
Author:chenyuehong |
Hits:
Description: 通过此源代码,能够实现如下功能:输入中缀表达式,实现后缀表达式的输出,然后求值-Through this source code, be able to achieve the following functions: Input infix expression, the expression of the output suffix implementation, then evaluation Platform: |
Size: 1024 |
Author:jialei |
Hits:
Description: 合理运用栈,按照教材中的运算优先级,编程实现任意中缀算术表达式的求值运算。-Rational use of the stack, in accordance with the teaching of computing priority, Programming arbitrary infix arithmetic expression evaluation operations. Platform: |
Size: 9216 |
Author:卡米力江 |
Hits:
Description: C++语言编的表达式求值-中缀表达式转为后缀表达式-C++ language for evaluation of the expression- expression to infix expressions suffix Platform: |
Size: 2048 |
Author:小杨 |
Hits:
Description: 数据结构线性表的应用,算术表达式求值,中缀转后缀算法,加减乘除基本运算-The application of the linear table data structure, arithmetic expression evaluation, infix suffix transfer algorithm, the basic operations addition and subtraction multiplication and division Platform: |
Size: 10240 |
Author:李维 |
Hits:
Description: C语言实现的表达式求值程序,由用户输入一个中缀表达式,系统自动求值,表达式中只含有加减乘除和括号这5种运算符。-C language implementation of the expression evaluation process from the user to enter an infix expression, the system automatically evaluated, the expression contains only addition and subtraction multiplication and division, and parentheses which five kinds of operators. Platform: |
Size: 14336 |
Author:刘龙 |
Hits:
Description: 中缀变后缀表达式求值:输入表达式,#为结束符(如1+2#),程序会自动给出后缀表达式,并给出最终计算结果。程序中部分地方有注释-Variable postfix infix expression evaluation: Enter the expression,# to end the character (eg, 1+2#), the program will automatically give postfix expression, and gives the end result. Some parts of the program annotated Platform: |
Size: 9216 |
Author:琦 |
Hits:
Description: 任意输入数学运算表达式分别采用两种算法求值,分别是中缀表达式直接求值和修改成后缀表达式求值。表达式中包含的运算符有:加法+,减法-,乘法*,除法/,括号(),乘方#等运算符。运算符的优先级和结合性符合数学运算法则-Any input math expressions using two algorithms evaluated, infix expression directly evaluated and modified the postfix expression evaluation. The expression contains operators: addition+, subtraction-, multiplication*, division /, parentheses (), involution#, and other operators. Operator precedence and associativity in line with the mathematical algorithm
Platform: |
Size: 910336 |
Author:fzk |
Hits:
Description: C++源码。输入中缀表达式,将其转成后缀表达式并求值。-C++ source. Enter the infix expression to turn them into postfix expression evaluation. Platform: |
Size: 2048 |
Author:zdcts |
Hits:
Description: 输入中缀算术表达式S,S中的操作数为非负整数,只含+,-和*,/运算,也可能含有括号(),运算符的计算顺序和实际四则运算的计算顺序相同. 输出表达式S的值. 注意除法运算只取整数部分,例如1/2=0.
Input
输入有多组数据.
每组数据是一个算术表达式S,S的长度不超过100. 输入的S保证合法,而且不包含多余的空格或制表符. S的操作数、中间结果和最终结果都不会超过int类型的范围,也不会出现除数为0的情况.
输入以#号结束.
Output
对于每个算术表达式S,输出S的值,每个输出占一行.-Input infix arithmetic expression S operand S in a non-negative integer, containing only+,-,*,/operator, may also contain brackets (), the same as the order of the calculation of the calculation order of the operator and the actual four computing.the value of the output of the expression S Note divide operations take only integer part, for example, 1/2 = 0.
Input
Input a plurality of sets of data.
Each set of data is an arithmetic expression S S length of no more than 100. Input S to ensure legitimate, but does not contain extra spaces or tabs. Operand of S, intermediate and final results will not exceed the int range of a type, and the divisor is 0, the situation does not occur.
Input end with a# sign.
Output
For each of the arithmetic expression S, the output value of S, and each output per line. Platform: |
Size: 6937600 |
Author:刘畅 |
Hits:
Description: 表达式求值是程序设计语言编译中的一个最基本问题。与人们习惯的中缀表示的表达式相比,后缀表达式不存在括号,没有优先级的差别,表达式中各个运算是按照运算符出现的顺序进行的。因此非常适合串行工作的计算机处理方式。该文首先对这两种表达式表示方法进行了分析比较,然后通过具体分析实现这两种表达式求值的算法来论证表达式后缀表示优于中缀表示。最后简要谈一下中缀表达式到后缀表达式的转换。-Evaluation of the expression is a basic problem in the programming language compiler. Compared to people accustomed to infix expressions, postfix expression does not exist in parentheses, no priority difference, the various arithmetic expression is carried out in accordance with the order of appearance of the operator. Therefore very suitable for computer processing of the serial work. In this paper, the analysis and comparison of both expressions representation of these two expressions evaluated algorithm, and then through a concrete analysis to demonstrate that the expression suffix indicates better than infix. Finally, a brief talk about infix expression to postfix expression conversion. Platform: |
Size: 130048 |
Author:逆水之寒 |
Hits:
Description: 数据结构中,使用栈来实现表达式的计算。先将中缀表达式转换成为后缀表达式,在将后缀表达式计算出结果。-Data structure, use the stack to achieve the calculated expression. First infix expression converted into postfix expression in the postfix expression calculated results. Platform: |
Size: 152576 |
Author:baiqiuju |
Hits: