文件名称:calculate
-
所属分类:
- 标签属性:
- 上传时间:2014-05-19
-
文件大小:4.2mb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
输入一个只包含个位数字的简单四则运算表达式字符串,计算该表达式的值
注:
1、表达式只含 +, -, *, / 四则运算符,不含括号
2、表达式数值只包含个位整数(0-9),且不会出现0作为除数的情况
3、要考虑加减乘除按通常四则运算规定的计算优先级
4、除法用整数除法,即仅保留除法运算结果的整数部分。比如8/3=2。输入表达式保证无0作为除数情况发生
5、输入字符串一定是符合题意合法的表达式,其中只包括数字字符和四则运算符字符,除此之外不含其它任何字符,不会出现计算溢出情况要求实现函数:int calculate(int len,char *expStr) -Enter a single digit contains only simple arithmetic expression string, calculate the value of the expression Note: 1, the expression containing only+,-,*,/four operators, excluding bracket 2, only the expression values contains a bit integers (0-9), and 0 as the divisor three cases to be considered by the arithmetic calculations are usually required four operations Priority 4 division with integer division, which retained only the result of integer division does not appear section. For example, 8/3 = 2. Enter the expression to ensure that no zero as the divisor happens 5, the input string must be in line with the legal meaning of the questions of expression, which includes only numeric characters and four operator characters, in addition to not contain any other characters, does not appear to calculate overflow conditions required to achieve the function: int calculate (int len, char* expStr)
注:
1、表达式只含 +, -, *, / 四则运算符,不含括号
2、表达式数值只包含个位整数(0-9),且不会出现0作为除数的情况
3、要考虑加减乘除按通常四则运算规定的计算优先级
4、除法用整数除法,即仅保留除法运算结果的整数部分。比如8/3=2。输入表达式保证无0作为除数情况发生
5、输入字符串一定是符合题意合法的表达式,其中只包括数字字符和四则运算符字符,除此之外不含其它任何字符,不会出现计算溢出情况要求实现函数:int calculate(int len,char *expStr) -Enter a single digit contains only simple arithmetic expression string, calculate the value of the expression Note: 1, the expression containing only+,-,*,/four operators, excluding bracket 2, only the expression values contains a bit integers (0-9), and 0 as the divisor three cases to be considered by the arithmetic calculations are usually required four operations Priority 4 division with integer division, which retained only the result of integer division does not appear section. For example, 8/3 = 2. Enter the expression to ensure that no zero as the divisor happens 5, the input string must be in line with the legal meaning of the questions of expression, which includes only numeric characters and four operator characters, in addition to not contain any other characters, does not appear to calculate overflow conditions required to achieve the function: int calculate (int len, char* expStr)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
calculate/calculate/calculate.cpp
calculate/calculate/calculate.vcxproj
calculate/calculate/calculate.vcxproj.filters
calculate/calculate/calculate.vcxproj.user
calculate/calculate/Debug/calculate.exe.embed.manifest
calculate/calculate/Debug/calculate.exe.embed.manifest.res
calculate/calculate/Debug/calculate.exe.intermediate.manifest
calculate/calculate/Debug/calculate.lastbuildstate
calculate/calculate/Debug/calculate.log
calculate/calculate/Debug/calculate.obj
calculate/calculate/Debug/calculate.vcxprojResolveAssemblyReference.cache
calculate/calculate/Debug/calculate.write.1.tlog
calculate/calculate/Debug/calculate_manifest.rc
calculate/calculate/Debug/cl.command.1.tlog
calculate/calculate/Debug/CL.read.1.tlog
calculate/calculate/Debug/CL.write.1.tlog
calculate/calculate/Debug/link.2460.read.1.tlog
calculate/calculate/Debug/link.2460.write.1.tlog
calculate/calculate/Debug/link.6688.read.1.tlog
calculate/calculate/Debug/link.6688.write.1.tlog
calculate/calculate/Debug/link.command.1.tlog
calculate/calculate/Debug/link.read.1.tlog
calculate/calculate/Debug/link.write.1.tlog
calculate/calculate/Debug/mt.command.1.tlog
calculate/calculate/Debug/mt.read.1.tlog
calculate/calculate/Debug/mt.write.1.tlog
calculate/calculate/Debug/rc.command.1.tlog
calculate/calculate/Debug/rc.read.1.tlog
calculate/calculate/Debug/rc.write.1.tlog
calculate/calculate/Debug/vc100.idb
calculate/calculate/Debug/vc100.pdb
calculate/calculate.sdf
calculate/calculate.sln
calculate/calculate.suo
calculate/Debug/calculate.exe
calculate/Debug/calculate.exe.manifest
calculate/Debug/calculate.ilk
calculate/Debug/calculate.pdb
calculate/ipch/calculate-f4bfac3f/calculate-705715a.ipch
calculate/calculate/Debug
calculate/ipch/calculate-f4bfac3f
calculate/calculate
calculate/Debug
calculate/ipch
calculate
calculate/calculate/calculate.vcxproj
calculate/calculate/calculate.vcxproj.filters
calculate/calculate/calculate.vcxproj.user
calculate/calculate/Debug/calculate.exe.embed.manifest
calculate/calculate/Debug/calculate.exe.embed.manifest.res
calculate/calculate/Debug/calculate.exe.intermediate.manifest
calculate/calculate/Debug/calculate.lastbuildstate
calculate/calculate/Debug/calculate.log
calculate/calculate/Debug/calculate.obj
calculate/calculate/Debug/calculate.vcxprojResolveAssemblyReference.cache
calculate/calculate/Debug/calculate.write.1.tlog
calculate/calculate/Debug/calculate_manifest.rc
calculate/calculate/Debug/cl.command.1.tlog
calculate/calculate/Debug/CL.read.1.tlog
calculate/calculate/Debug/CL.write.1.tlog
calculate/calculate/Debug/link.2460.read.1.tlog
calculate/calculate/Debug/link.2460.write.1.tlog
calculate/calculate/Debug/link.6688.read.1.tlog
calculate/calculate/Debug/link.6688.write.1.tlog
calculate/calculate/Debug/link.command.1.tlog
calculate/calculate/Debug/link.read.1.tlog
calculate/calculate/Debug/link.write.1.tlog
calculate/calculate/Debug/mt.command.1.tlog
calculate/calculate/Debug/mt.read.1.tlog
calculate/calculate/Debug/mt.write.1.tlog
calculate/calculate/Debug/rc.command.1.tlog
calculate/calculate/Debug/rc.read.1.tlog
calculate/calculate/Debug/rc.write.1.tlog
calculate/calculate/Debug/vc100.idb
calculate/calculate/Debug/vc100.pdb
calculate/calculate.sdf
calculate/calculate.sln
calculate/calculate.suo
calculate/Debug/calculate.exe
calculate/Debug/calculate.exe.manifest
calculate/Debug/calculate.ilk
calculate/Debug/calculate.pdb
calculate/ipch/calculate-f4bfac3f/calculate-705715a.ipch
calculate/calculate/Debug
calculate/ipch/calculate-f4bfac3f
calculate/calculate
calculate/Debug
calculate/ipch
calculate
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.