#CCBCHMUOI0000011. Chọn phép toán (Select an Arithmetic Operation)
Chọn phép toán (Select an Arithmetic Operation)
Select an Arithmetic Operation
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given integers a and b and operator character op, compute a+b, a-b or a*b for +, - or *, respectively. For any other operator print INVALID. Preserve operand order for subtraction.
Input
One line contains integers a and b followed by a non-whitespace operator character.
Output
Print the integer result on one line for +, - or *; otherwise print INVALID.
Subtasks
-
Subtask 1 (20 points): 0 <= a,b <= 10 and op is +.
-
Subtask 2 (30 points): -100 <= a,b <= 100 and op is + or -.
-
Subtask 3 (50 points): -10000 <= a,b <= 10000; op is visible ASCII 33–126.
Examples
Example 1
Input
5 -2 -
Output
7
Explanation
For subtraction, 5 - (-2) equals 7.
Example 2
Input
3 4 /
Output
INVALID
Explanation
Slash is not among the supported operators, so print INVALID.