Three-Way Comparison
Time limit2sMemory limit1024 MB
Given two integers A and B, the task is to print -1, 0, or 1 depending on whether A is less than, equal to, or greater than B.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Two integers A and B are given. Compare A and B. Print -1 if A < B, 0 if A = B, and 1 if A > B.
Input
The input is given from standard input in the following format.
A
B
Output
Print -1 if A < B, 0 if A = B, and 1 if A > B.
Constraints
1 ≤ A ≤ 1000.1 ≤ B ≤ 1000.AandBare integers.