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

PROGRAMMING:A simple calculator for two numbers

Luz5年前 (2021-05-10)题库398
This problem requires the preparation of a simple calculator program, according to the input operator, two integers for addition, subtraction, multiplication, division or remainder operations. Ensure that the input and output do not exceed the integer range.
###Input format:
Input in a row, enter the operands 1, operator, and operands 2, separated by a space. The data type of operands is integer, and the denominator of division and remainder is nonzero.
###Output format:
When the operators are '+', '-', '*', '/', '%', the corresponding operation results are output in one line. If the input is an illegal symbol (other than the five operators of addition, subtraction, multiplication, division and remainder), output 'error'.
###Input sample 1:
```in
-7 / 2
```
###Output sample 1:
```out
-3
```
###Input example 2:
```
3 & 6
```
###Output example 2:
```
ERROR
```






answer:If there is no answer, please comment