less than 1 minute read

문제

여기를 눌러 문제를 확인하세요.

코드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int y = sc.nextInt();
		
		if(x > 0 && y > 0) {
			System.out.println(1);
		}else if(x > 0 && y < 0) {
			System.out.println(4);
		}else if(x < 0 && y < 0) {
			System.out.println(3);
		}else {
			System.out.println(2);
		}
		
		sc.close();
	}

}