文件名称:compute
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:2.77kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
表达式求值:给定一个浮点数混合运算的中缀表达式,分别实现:转换成为后缀表达式,然后求值;直接对中缀表达式求值两种求值算法两种实现方法。表达式中包含的运算符:加法+,减法-,乘法*,除法/,括号(),乘方#等运算符。运算符的优先级和结合性符合数学运算法则。比如:命令行输入 (-2.0)+(1.0+2.0)*3.0-2.0#2.0回车
(1)中缀表达式输出:
(-2.0)+ (1.0+2.0)*3.0-2.0#2.0=3.0
(2)后缀表达式输出:
-2.0 1.0 2.0 + 3.0 * + 2.0 2.0 # -
(-2.0)+ (1.0+2.0)*3.0-2.0#2.0=3.0-Expression evaluation: in infix expression to a floating point number to the mix operator, respectively, to achieve: convert postfix expression and then evaluated infix expression evaluation are two evaluation algorithms implemented in two methods. The expression contains operators: addition+, subtraction-, multiplication*, division /, parentheses (), involution#, and other operators. Operator precedence and associativity of the mathematical algorithm. For example: the command-line input (-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 Enter
(1) infix expression output:
(-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 = 3.0
(2) postfix expression output:
-2.0 1.0 2.0+ 3.0*+ 2.0 2.0-
(-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 = 3.0
(1)中缀表达式输出:
(-2.0)+ (1.0+2.0)*3.0-2.0#2.0=3.0
(2)后缀表达式输出:
-2.0 1.0 2.0 + 3.0 * + 2.0 2.0 # -
(-2.0)+ (1.0+2.0)*3.0-2.0#2.0=3.0-Expression evaluation: in infix expression to a floating point number to the mix operator, respectively, to achieve: convert postfix expression and then evaluated infix expression evaluation are two evaluation algorithms implemented in two methods. The expression contains operators: addition+, subtraction-, multiplication*, division /, parentheses (), involution#, and other operators. Operator precedence and associativity of the mathematical algorithm. For example: the command-line input (-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 Enter
(1) infix expression output:
(-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 = 3.0
(2) postfix expression output:
-2.0 1.0 2.0+ 3.0*+ 2.0 2.0-
(-2.0)+ (1.0+2.0)* 3.0-2.0# 2.0 = 3.0
(系统自动生成,下载前可以参看下载内容)
下载文件列表
compute.cpp
functions.h
main.cpp
Stack.h
functions.h
main.cpp
Stack.h
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.