文件名称:main
-
所属分类:
- 标签属性:
- 上传时间:2013-11-02
-
文件大小:1.41kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
问题描述
中缀表达式就是我们通常所书写的数学表达式,后缀表达式也称为逆波兰表达式,在编译程序对我们书写的程序中的表达式进行语法检查时,往往就可以通过逆波兰表达式进行。我们所要设计并实现的程序就是将中缀表示的算术表达式转换成后缀表示,例如,将中缀表达式
(A 一 (B*C 十 D)*E) / (F 十 G )
转换为后缀表示为:
ABC*D十E*—FG十/
注意:为了简化编程实现,假定变量名均为单个字母,运算符只有+,-,*,/ 和^(指数运算),可以处理圆括号(),并假定输入的算术表达式正确。
要求:使用栈数据结构实现 ,输入的中缀表达式以#号结束
输入
整数N。表示下面有N个中缀表达式
N个由单个字母和运算符构成的表达式
输出
N个后缀表达式。
-Problem Descr iption infix expression is what we usually write mathematical expressions, the suffix expressions are also called Reverse Polish Notation in compiler writing program for our expression syntax checking, often it can be reverse Polish expression. We want to design and implement programs that will infix arithmetic expression into a suffix, for example, the infix expression (A a (B* C ten D)* E)/(F ten G) is converted to the suffix expressed as: ABC* D ten E*-FG ten/Note: To simplify programming, assuming the variable names are a single letter, operators only+,-,*, /, and ^ (exponentiation), can handle parentheses ( ), and assumes that the input of the arithmetic expression is correct. Requirements: Using the stack data structure, the input infix expression input integer ending with# N. Here there are N represents infix expression of N by a single letter and operators constitute an expression output N suffix expressions.
中缀表达式就是我们通常所书写的数学表达式,后缀表达式也称为逆波兰表达式,在编译程序对我们书写的程序中的表达式进行语法检查时,往往就可以通过逆波兰表达式进行。我们所要设计并实现的程序就是将中缀表示的算术表达式转换成后缀表示,例如,将中缀表达式
(A 一 (B*C 十 D)*E) / (F 十 G )
转换为后缀表示为:
ABC*D十E*—FG十/
注意:为了简化编程实现,假定变量名均为单个字母,运算符只有+,-,*,/ 和^(指数运算),可以处理圆括号(),并假定输入的算术表达式正确。
要求:使用栈数据结构实现 ,输入的中缀表达式以#号结束
输入
整数N。表示下面有N个中缀表达式
N个由单个字母和运算符构成的表达式
输出
N个后缀表达式。
-Problem Descr iption infix expression is what we usually write mathematical expressions, the suffix expressions are also called Reverse Polish Notation in compiler writing program for our expression syntax checking, often it can be reverse Polish expression. We want to design and implement programs that will infix arithmetic expression into a suffix, for example, the infix expression (A a (B* C ten D)* E)/(F ten G) is converted to the suffix expressed as: ABC* D ten E*-FG ten/Note: To simplify programming, assuming the variable names are a single letter, operators only+,-,*, /, and ^ (exponentiation), can handle parentheses ( ), and assumes that the input of the arithmetic expression is correct. Requirements: Using the stack data structure, the input infix expression input integer ending with# N. Here there are N represents infix expression of N by a single letter and operators constitute an expression output N suffix expressions.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
main.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.