文件名称:goodjsq
介绍说明--下载内容均来自于网络,请自行研究使用
设计一个简单的计算器类(类型),要求:
(1) 从键盘读入算式。
(2) 可以进行加、减、乘、除运算。
(3) 运算要有优先级。
(4) 用户可以按任何的运算符出现顺序进行输入。
(5) 不限定用户输入的计算式的长度。
(6) 有排错功能,当用户输入错误的算式时提示用户。
例如,如果用户输入:3 + 4 * 5 - 7,计算结果应为16。
(提示:可以使用本节所定义的栈类来帮助进行处理)。-Design a simple calculator-type (type), requirements: (1) Reading from the keyboard into the formula. (2) can add, subtract, multiply, with the exception of computing. (3) The operator must have priority. (4) the user can press any of the emergence of the order of operator input. (5) does not limit the user to enter the length of the calculation formula. (6) have debugging function, when the user enters the wrong formula when prompts the user. For example, if a user enters: 3+ 4* 5- 7, the calculation results should be 16. (Hint: You can use this section of the stack type definition to help to deal with).
(1) 从键盘读入算式。
(2) 可以进行加、减、乘、除运算。
(3) 运算要有优先级。
(4) 用户可以按任何的运算符出现顺序进行输入。
(5) 不限定用户输入的计算式的长度。
(6) 有排错功能,当用户输入错误的算式时提示用户。
例如,如果用户输入:3 + 4 * 5 - 7,计算结果应为16。
(提示:可以使用本节所定义的栈类来帮助进行处理)。-Design a simple calculator-type (type), requirements: (1) Reading from the keyboard into the formula. (2) can add, subtract, multiply, with the exception of computing. (3) The operator must have priority. (4) the user can press any of the emergence of the order of operator input. (5) does not limit the user to enter the length of the calculation formula. (6) have debugging function, when the user enters the wrong formula when prompts the user. For example, if a user enters: 3+ 4* 5- 7, the calculation results should be 16. (Hint: You can use this section of the stack type definition to help to deal with).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
goodjsq.cpp