练习专区

今天的一小步就是明天的一大步
Problem 1051 计算器程序
Accepted: 28   Total Submit: 87
Time Limit: 1000ms   Memory Limit: 30720KB
Description
用户输入运算数和四则运算符,输出运算结果。当输入运算符不是"+"、"-"、"*"或"/"时提示出错,当输入除数为0时也提示出错。
Input
输入有若干行,每行一个浮点型运算数、运算符、另一个浮点型运算数。假设输入都是有意义。
Output
先输出一个“=”,再输出运算结果。
Sample Input
4.5/2
-3-2
2*8
3.5+4.2
2#4
-100/0
Sample Output
=2.250000
=-5.000000
=16.000000
=7.700000
Enter date error
Enter date error
Hint
提交     返回