文件名称:expression
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 106kb
- 下载次数:
- 0次
- 提 供 者:
- 马**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
需求分析
(1) 任何一个表达式都是由操作数、运算符和界限符组成的,我们称之为单词.
(2) 表达式求值首先要符合四则运算规则:
① 先乘除,后加减
② 从左到右进行运算
③ 先括号内,后括号外
(3) 功能实现:
① 若当前单词为数字串,则压入数值栈
② 若当前单词为运算符并大于运算栈的栈顶符号,则进栈
③ 若当前单词为运算符并等于运算栈的栈顶符号,去括号,输出
④ 若当前单词为运算符并小于运算栈的栈顶符号,则进行运算
-Needs analysis (1) an expression by any operand, operator, and at the composition of the boundaries, we call words. (2) the expression for the value of the first four operations to comply with the rules: ① first multiplication and division, after From left to right to conduct operations by ② ③ first brackets, the brackets after the outside (3) functions: ① If the current word number string, then pressed into numerical stack ② If the current word is greater than for the operator and operator of Top-stack symbols, then into the stack word ③ If the current operator and is equivalent to computing the Top-stack symbols, to brackets, output ④ If the current word for the operator and less than computing the Top-stack symbols, were carried out in computing
(1) 任何一个表达式都是由操作数、运算符和界限符组成的,我们称之为单词.
(2) 表达式求值首先要符合四则运算规则:
① 先乘除,后加减
② 从左到右进行运算
③ 先括号内,后括号外
(3) 功能实现:
① 若当前单词为数字串,则压入数值栈
② 若当前单词为运算符并大于运算栈的栈顶符号,则进栈
③ 若当前单词为运算符并等于运算栈的栈顶符号,去括号,输出
④ 若当前单词为运算符并小于运算栈的栈顶符号,则进行运算
-Needs analysis (1) an expression by any operand, operator, and at the composition of the boundaries, we call words. (2) the expression for the value of the first four operations to comply with the rules: ① first multiplication and division, after From left to right to conduct operations by ② ③ first brackets, the brackets after the outside (3) functions: ① If the current word number string, then pressed into numerical stack ② If the current word is greater than for the operator and operator of Top-stack symbols, then into the stack word ③ If the current operator and is equivalent to computing the Top-stack symbols, to brackets, output ④ If the current word for the operator and less than computing the Top-stack symbols, were carried out in computing
(系统自动生成,下载前可以参看下载内容)
下载文件列表
表达式
......\bds.cpp
......\bds.dsp
......\bds.dsw
......\bds.ncb
......\bds.opt
......\bds.plg
......\Debug
......\.....\bds.exe
......\.....\bds.obj
......\.....\bds.pdb
......\.....\vc60.pdb
......\bds.cpp
......\bds.dsp
......\bds.dsw
......\bds.ncb
......\bds.opt
......\bds.plg
......\Debug
......\.....\bds.exe
......\.....\bds.obj
......\.....\bds.pdb
......\.....\vc60.pdb