编程介的小学生 2019-04-16 17:39 采纳率: 20.5%
浏览 171

表达式的计算的问题怎么实现,运用C语言的程序的设计的思路的实现

Problem Description
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.

Input
There are several test cases, each occupies one line that contains an infix expression. Proceed until the end of the file.

Output
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”.

Sample Input
4.99+5.99+6.99*1.06
(3*5*(4*8)%2)
1+2(
2/0
2.5%2
2%2.5

Sample Output
18.39
0.00
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION
ERROR IN INFIX NOTATION

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 用C语言输入方程怎么
    • ¥15 网站显示不安全连接问题
    • ¥15 github训练的模型参数无法下载
    • ¥15 51单片机显示器问题
    • ¥20 关于#qt#的问题:Qt代码的移植问题
    • ¥50 求图像处理的matlab方案
    • ¥50 winform中使用edge的Kiosk模式
    • ¥15 关于#python#的问题:功能监听网页
    • ¥15 怎么让wx群机器人发送音乐
    • ¥15 fesafe材料库问题