当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2556:Simple Desk Calculator

题目描述
Your task are to write a program that imitates a simple desk calculator. Your calculator must be able to accept an infix expression which at least includes (, ), +, -, *, /,% . If the expression is legal, output its value, else ouput an error message.
输入解释
There are several test cases, each occupies one line that contains an infix expression. Proceed until the end of the file.
输出解释
For each test case, in one line the value of that expression ( accurate up to two decimal places), or an error message “ERROR IN INFIX NOTATION”.
输入样例
4.99+5.99+6.99*1.06
(3*5*(4*8)%2)
1+2(
2/0
2.5%2
2%2.5
输出样例
18.39
0.00
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION
来自杭电HDUOJ的附加信息
Author hjr
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2556

最后修改于 2020-10-25T22:54:36+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)