Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigDecimal;
- import java.util.Scanner;
- public class Test {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- BigDecimal xCoordinate = input.nextBigDecimal();
- BigDecimal yCoordinate = input.nextBigDecimal();
- BigDecimal zero = new BigDecimal(0);
- if ((xCoordinate.compareTo(zero) == 1) &&
- (yCoordinate.compareTo(zero) == 1)) {
- System.out.println(1);
- }
- else if ((xCoordinate.compareTo(zero) == -1) &&
- (yCoordinate.compareTo(zero)) == 1) {
- System.out.println(2);
- }
- else if ((xCoordinate.compareTo(zero) == -1) &&
- yCoordinate.compareTo(zero) == -1) {
- System.out.println(3);
- }
- else if ((xCoordinate.compareTo(zero) == 1) &&
- (yCoordinate.compareTo(zero)) == -1) {
- System.out.println(4);
- }
- else if(xCoordinate.equals(0) && yCoordinate.equals(0)) {
- System.out.println(0);
- }
- else if (xCoordinate.equals(0)) {
- System.out.println(5);
- }
- else {
- System.out.println(6);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement