문제

문제출처 : Baekjoon

img

풀이

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();

        if(x > 0){
            if(y > 0){
                System.out.println("1");
            }else{
                System.out.println("4");
            }
        }else{
            if(y > 0){
                System.out.println("2");
            }else{
                System.out.println("3");
            }
        }
    }
}

회고

  1. 알고보니 예전에 풀었던 문제인데 ㅋㅋㅋ 확인해보니 그때보다 더 간결한 코드로 풀었다. 조금 성장한것 같기도 하다.