Submit | All submissions | Best solutions | Back to list |
Problem hidden on 2011-08-21 09:05:45 by [Trichromatic] XilinX
ARTHOP - Arithmetic Operations |
Arithmetic operations
You'll be given 3 numbers A, B and C. and you should determine what is the operator used with A and B to get C. for example if A = 5 and B = 3 and C = 8, so the wanted operator is '+'.
Input
You'll be given the three numbers (A, B and C) separated by space. (0<= A,B,C <= 1000)
Output
The operator can be one of those operators ('+', '-', '*', '/', '%' and '^'), print the convenient operator in a line by itself. If there is no any appropriate operator then print (!). If you found more than one operator then print the operator with highest priority. This is their sorting from max to min (+,-,*,/,%,^).
Note: the operator '^' represents the power operation.
Sample Input
3 5 8
2 6 64
50 5 10
2 19 38
29 15 14
2 3 4
Sample Output
+
^
/
*
-
!
Added by: | Sharaf |
Date: | 2011-08-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C C++ 4.3.2 JAVA |