二十四桥月 2014-03-18 15:34
浏览 964

关于 desk calculator 程序

这是原题:
Project 1: Desk Calculator
This project requires you to write a program that imitates a simple desk
calculator. Your calculator must be able to accept an infix expression which at least
includes (, ), +, -, *, /, %, and ^ (exponentiation operator, a^b = a ). If the expression is
legal, output its value, else output an error message.

Input Specification:

ourprogrammustreadtestcasesfromafile“input.txt”. In the file there are
several test cases, each occupies one line that contains an infix expression. Proceed until the end of the file.

Output Specification:

for each test case,output to a file “output.txt”in one line the value of that
expression(accurate up to two decimalplaces),or an error message“ERROR"
老师说这是浙大教科书上的一道题,看到这个我真的傻眼了,求大神
”.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 不重复生成字母+数字交易号
    • ¥15 AD封装导入后层混乱了
    • ¥15 如何将excel中的数据导入ansys中
    • ¥15 MATLAB中图像问题
    • ¥15 rk3399 安卓7.1 应用音频无声音
    • ¥20 Chatgpt被封号以后,换用apple和gmail注册失败,直接跳转封号界面
    • ¥15 这几个有点疑问解答一下
    • ¥15 r语言如何绘制这样的降水地图
    • ¥15 服务器一块硬盘重启过程中安装后,硬盘不识别了怎么修复?
    • ¥15 怎么实现微信红包不拆包