[java] 프로그래머스 - 점의 위치 구하기

세상을 바꾸는 개발자·2023년 3월 11일
0

[문제링크 - 프로그래머스 - 점의 위치 구하기] https://school.programmers.co.kr/learn/courses/30/lessons/120841

class Solution {
    public int solution(int[] dot) {
        if(dot[0] > 0 && dot[1] > 0){
            return 1;
        }
        else if(dot[0] < 0 && dot[1] > 0){
            return 2;
        }
        else if(dot[0] < 0 && dot[1] < 0){
            return 3;
        }
        else {
            return 4;
        }
    }
}
profile
초심 잃지 않기

0개의 댓글