class Solution {
public int solution(int[] dot) {
int answer = 0;
if(dot[0] > 0 && dot[1] > 0) {
answer = 1;
} else if(dot[0] < 0 && dot[1] > 0) {
answer = 2;
} else if(dot[0] < 0 && dot[1] < 0) {
answer = 3;
} else {
answer = 4;
}
return answer;
}
}
class Solution {
public int solution(int[] dot) {
return dot[0] > 0 && dot[1] > 0 ? 1 : dot[0] < 0 && dot[1] > 0 ? 2 : dot[0] > 0 && dot[1] < 0 ? 4 : 3;
}
}
아주 유용한 정보네요!