文件名称:Final
介绍说明--下载内容来自于网络,使用问题请自行百度
数学表达式求值
编写一个求解包括+、-、×、÷ 运算符的数学表达式值的程序,要求如下:
(1)具有操作界面;
(2)采用算符优先分析法求解数学表达式的值;
(3)可以测试多个数学表达式,每个数学表达式通过键盘输入,可以是合法的数学表达式,
也可以是不合法的数学表达式;
(4)如果数学表达式是合法的,则将数学表达式及其值保存到Mathematical-Expression.txt
文件中;否则将数学表达式及提示信息保存到Mathematical-Expression.txt 文件中,文件格
式示例如下:
数学表达式:16+2*3-14+7*2
值:22
数学表达式:3*+4/2
提示信息:数学表达式不合法
数学表达式:21-12/2+16-2*3+6/3
值:27(Evaluation of mathematical expressions
The preparation of a solution including +, -, *, / operator the mathematical expressions of the value of the program, the requirements are as follows:
(1) having operation interface;
(2) the operator priority analysis method is used to solve the mathematical expressions;
(3) you can test multiple mathematical expressions. Each mathematical expression is entered by keyboard. It can be a valid mathematical expression,
It can also be an illegal mathematical expression;
(4) if the mathematical expression is legal, the math expression and its values are saved to Mathematical-Expression.txt
In the file; otherwise, save the math expressions and prompt information into the Mathematical-Expression.txt file
Examples are as follows:
Mathematical expression: 16+2*3-14+7*2
Value: 22
Mathematical expression: 3*+4/2
Prompt information: mathematical expression is illegal
Mathematical expression: 21-12/2+16-2*3+6/3
Value: 27)
编写一个求解包括+、-、×、÷ 运算符的数学表达式值的程序,要求如下:
(1)具有操作界面;
(2)采用算符优先分析法求解数学表达式的值;
(3)可以测试多个数学表达式,每个数学表达式通过键盘输入,可以是合法的数学表达式,
也可以是不合法的数学表达式;
(4)如果数学表达式是合法的,则将数学表达式及其值保存到Mathematical-Expression.txt
文件中;否则将数学表达式及提示信息保存到Mathematical-Expression.txt 文件中,文件格
式示例如下:
数学表达式:16+2*3-14+7*2
值:22
数学表达式:3*+4/2
提示信息:数学表达式不合法
数学表达式:21-12/2+16-2*3+6/3
值:27(Evaluation of mathematical expressions
The preparation of a solution including +, -, *, / operator the mathematical expressions of the value of the program, the requirements are as follows:
(1) having operation interface;
(2) the operator priority analysis method is used to solve the mathematical expressions;
(3) you can test multiple mathematical expressions. Each mathematical expression is entered by keyboard. It can be a valid mathematical expression,
It can also be an illegal mathematical expression;
(4) if the mathematical expression is legal, the math expression and its values are saved to Mathematical-Expression.txt
In the file; otherwise, save the math expressions and prompt information into the Mathematical-Expression.txt file
Examples are as follows:
Mathematical expression: 16+2*3-14+7*2
Value: 22
Mathematical expression: 3*+4/2
Prompt information: mathematical expression is illegal
Mathematical expression: 21-12/2+16-2*3+6/3
Value: 27)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2015级《数据结构实验》期末设计报告.doc
Final
Final\bin
Final\bin\Debug
Final\bin\Debug\Final.exe
Final\Final.cbp
Final\Final.depend
Final\Final.layout
Final\main.c
Final\Matchematical-Expression.txt
Final\obj
Final\obj\Debug
Final\obj\Debug\main.o
Final
Final\bin
Final\bin\Debug
Final\bin\Debug\Final.exe
Final\Final.cbp
Final\Final.depend
Final\Final.layout
Final\main.c
Final\Matchematical-Expression.txt
Final\obj
Final\obj\Debug
Final\obj\Debug\main.o
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.