hoj 1368 Very Simple Arithmetic java 高精度

Very Simple Arithmetic

My Tags  (Edit)
  Source : L
  Time limit : 5 sec   Memory limit : 32 M

Submitted : 1100, Accepted : 186

Lee is a lovely 10 year old boy. Recently, his parents found out that Lee often makes stupid mistakes in simple arithmetic in the exams. Therefore, they decide to help him with his calculating ability. They assigned him a lot of exercises. However, they are tired of calculating the results, in which process they themselves might make mistakes sporadically. So they've hired you to write a program to generate correct answers for simple arithmetic problems.

Input

There are several test cases. Each test case is in one of the following formats:

a + b
a - b
a * b
a / b c

where a,b,c are integers, 0 <= a,b <= 10300, 0 <= c <= 80.

There is always a single white space between the operator and the operands, and the divisor will never be 0.

Output

For the '+', '-' and '*' operation, you should print on a single line a single number, which is the result of the operation. For the '/' operation, you should print on a single line three numbers: the first one is the integer part of the quotient, the second is the remainder, and the last one is a float number, which is the quotient rounded to c decimal places (see examples below).

Sample Input

2 + 5
3 - 4
12 * 4
10 / 3 3

Sample Output

7
-1
48
3 1 3.333
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值