728x90

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class BeakJoon_14681 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        int X = Integer.parseInt(br.readLine());
        int Y = Integer.parseInt(br.readLine());
 
        if (X > 0) { //x가 0보다 클때
            if (Y > 0) {
                System.out.print(1); //Y가 0보다 크면 1사분면
            } else {
                System.out.print(4); //Y가 0보다 작으면 4사분면
            }
        } else{ //X가 0보다 작을때
            if(Y > 0){
                System.out.print(2); //Y가 0보다 크면 2사분면
            }else{
                System.out.print(3); //Y가 0보다 작으면 3사분면
            }
        }
 
    }
}
 
cs

 

728x90

'Dev > 알고리즘 ,자료구조' 카테고리의 다른 글

[Algorithm]BeakJoon_11399  (0) 2021.07.18
[Algorithm]BeakJoon_1931  (0) 2021.07.18
[Algorithm]BeakJoon_1330  (0) 2021.07.18
Insertion_Sort(삽입 정렬)  (0) 2021.06.30
Selection_Sort(선택 정렬)  (0) 2021.06.29