Nathan Coulas

CCC '17 J1 - Quadrant Selection

ccc17j1 JAVA8 05 Nov, 2019 2.702s 3 points

Source Code

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        
        if(a > 0 && b > 0){
            System.out.println("1");
        }else if(a > 0 && b < 0){
            System.out.println("4");
        }else if(a < 0 && b > 0){
            System.out.println("2");
        }else if(a < 0 && b < 0){
            System.out.println("3");
        }
    }
}