# [JAVA] 점의 위치 구하기

> x 좌표 (x, y)를 차례대로 담은 정수 배열 dot이 매개변수로 주어집니다. 좌표 dot이 사분면 중 어디에 속하는지 1, 2, 3, 4 중 하나를 return 하도록 solution 함수를 완성해주세요.

![Image](https://upload.cafenono.com/image/slashpagePost/20250407/135921_mJavxaaiLfIadDunS6?q=80&s=1280x180&t=outside&f=webp)

---

### ◇ 내 답변

```
class Solution {
    public int solution(int[] dot) {
        int answer = 0;
        
        if (dot[0] > 0) {
            if (dot[1] > 0) {
             answer = 1;   
            } else {
             answer = 4;
            }
            
        } else {
            if (dot[1] > 0) {
                answer = 2;
            } else {
                answer = 3;
            }
        }
        
        return answer;
    }
}
```

1. 반복뺑이돌리기

For the site tree, see the [root Markdown](https://slashpage.com/%EB%AC%B4%EB%91%A5-rypb2.md).
