-->
当前位置:首页 > 题库

PROGRAMMING:add , subtract , multiply and divide

Luz5年前 (2021-05-10)题库417
###Task description
```
According to the input operator, simple integer operation is performed on the input integer.
Operators will only be plus +, minus -, multiplication *, division /, remainder%, factorial! One of six operators.
Output the result of the operation. If the divisor is zero, "error" is output. If the second operand of the complement operation is 0, "error" is also output.
```
###Input format:
```
Enter as one line. First input the first integer, space input operator, and then space input the second integer, enter to end the input. If the operator is factorial! Sign, then do not enter the second integer, directly enter to end the input.
```
###Output format:
```
The output is one line. Output two (or one) numbers of input, the result calculated according to the input operator, or "error".
```
###Input example:
```in
12 + 34
54 - 25
3 * 6
45 / 0
5 !
34 % 0
```
###Output example:
```out
forty-six
twenty-nine
eighteen
error
one hundred and twenty
error
```
###Tips
The operation does not go beyond the range of integer data. 0!= 1; There are multiple sets of test data.
###Title Source
Note: selected from openjudge website, online address: http://sdau.openjudge.cn/c/044/







answer:If there is no answer, please comment