operacija
Four numbers A, B, [] and op are given. Number op have following meaning:
- op = 1 addition,
- op = 2 substaction,
- op = 3 multiplying,
- op = 4 division.
For given input data write 1 if A op B = C, else write 0.
InputIn first line of standard input are integers A, B, C and op (0 <= A, B, C <= 10,000,000,000, 1 <= op <= 4).
OutputIn first row of standard output write 0 or 1, depending of above constrains.
Note:
In at least 50% tests op will be 1 or 2.
60% tests will have values for A, B i C from [0, 100].
Input:
[c]1 2 3 1
Output:
Explanation:
Expression 1 + 2 = 3 is correct, so output is 1.
[c]1 2 3 1
Output:
1Explanation:
Expression 1 + 2 = 3 is correct, so output is 1.
Input:
Output:
2 1 2 4Output:
1Input:
Output:
Explanation:
3 / 2 = 1.5, so 3 / 2 = 1 is not correct.
3 2 1 4Output:
0Explanation:
3 / 2 = 1.5, so 3 / 2 = 1 is not correct.
Input:
Output:
Explanation:
4 * 5 = 20.
4 5 21 3Output:
0Explanation:
4 * 5 = 20.
Input:
Output:
55 5 50 2Output:
1Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.