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

PROGRAMMING:A simple calculator

Luz5年前 (2021-05-10)题库445
###Task description
A simplest calculator, support +, -, *, / four kinds of operation. Only when the input and output are integers, the data and operation results will not exceed the range of int.
###Input format:
There is only one line of input, and there are three parameters in total. The first and second parameters are integers, and the third parameter is operator (+,, *, /).
###Output format:
Output only one line, an integer, as the result of the operation. However:
1. If the divisor is 0, output: divided by zero!
2. If there is an invalid operator (that is, it is not one of +, -, *, / then output: invalid operator!
###Input example:
```in
1 2 +
```
###Output example:
```out
three
```
###Title Source
This topic is selected from openjudge website http://noi.openjudge.cn/ch0104/19/ .







answer:If there is no answer, please comment