文件名称:Convert-infix
介绍说明--下载内容均来自于网络,请自行研究使用
问题描述
中缀表达式就是我们通常所书写的数学表达式,后缀表达式也称为逆波兰表达式,在编译程序对我们书写的程序中的表达式进行语法检查时,往往就可以通过逆波兰表达式进行。我们所要设计并实现的程序就是将中缀表示的算术表达式转换成后缀表示,例如,将中缀表达式
(A 一 (B*C 十 D)*E) / (F 十 G )
转换为后缀表示为:
ABC*D十E* FG十/
注意:为了简化编程实现,假定变量名均为单个字母,运算符只有+,-,*,/ 和^(指数运算),可以处理圆括号(),并假定输入的算术表达式正确。
要求:使用栈数据结构实现 ,输入的中缀表达式以#号结束
输入
整数N。表示下面有N个中缀表达式
N个由单个字母和运算符构成的表达式
输出
N个后缀表达式。
-Problem descr iption
Is the infix expression we usually write mathematical expressions, postfix expression also known as anti Poland formula, the compiler checks the syntax of expressions we write in the program, often can be carried out by the anti Poland formula. We need to design and implement a program that will convert infix arithmetic expressions representing suffixes for example, infix expression
(A 1 (B*C ten D) *E () / (F ten G)
Convert to suffix:
ABC*D ten E* FG ten
Note: in order to simplify the programming, assume that the variables are single letters, only the operator +, -, *, / and ^ (exponentiation), can handle the parentheses (), and assume that the input arithmetic expression right.
Requirements: to achieve the use of stack data structure, to the end of the input infix expression directly.
input
Integer N. Express the following N infix expression
N expressions that consist of a single letter and operator
output
N suffix expression.
中缀表达式就是我们通常所书写的数学表达式,后缀表达式也称为逆波兰表达式,在编译程序对我们书写的程序中的表达式进行语法检查时,往往就可以通过逆波兰表达式进行。我们所要设计并实现的程序就是将中缀表示的算术表达式转换成后缀表示,例如,将中缀表达式
(A 一 (B*C 十 D)*E) / (F 十 G )
转换为后缀表示为:
ABC*D十E* FG十/
注意:为了简化编程实现,假定变量名均为单个字母,运算符只有+,-,*,/ 和^(指数运算),可以处理圆括号(),并假定输入的算术表达式正确。
要求:使用栈数据结构实现 ,输入的中缀表达式以#号结束
输入
整数N。表示下面有N个中缀表达式
N个由单个字母和运算符构成的表达式
输出
N个后缀表达式。
-Problem descr iption
Is the infix expression we usually write mathematical expressions, postfix expression also known as anti Poland formula, the compiler checks the syntax of expressions we write in the program, often can be carried out by the anti Poland formula. We need to design and implement a program that will convert infix arithmetic expressions representing suffixes for example, infix expression
(A 1 (B*C ten D) *E () / (F ten G)
Convert to suffix:
ABC*D ten E* FG ten
Note: in order to simplify the programming, assume that the variables are single letters, only the operator +, -, *, / and ^ (exponentiation), can handle the parentheses (), and assume that the input arithmetic expression right.
Requirements: to achieve the use of stack data structure, to the end of the input infix expression directly.
input
Integer N. Express the following N infix expression
N expressions that consist of a single letter and operator
output
N suffix expression.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Convert infix.rar.cpp