점의 위치 구하기

김세호·2022년 12월 4일
0

내 풀이

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

0개의 댓글