make it simple
article thumbnail

https://www.acmicpc.net/problem/2490

 

2490번: 윷놀이

우리나라 고유의 윷놀이는 네 개의 윷짝을 던져서 배(0)와 등(1)이 나오는 숫자를 세어 도, 개, 걸, 윷, 모를 결정한다. 네 개 윷짝을 던져서 나온 각 윷짝의 배 혹은 등 정보가 주어질 때 도(배 한

www.acmicpc.net

public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);

    int[][] input = new int[3][4];

    for(int i=0;i<input.length;i++){
        for(int j=0;j<input[i].length;j++){
            input[i][j] = sc.nextInt();
        }
    }

    for(int i=0;i<input.length;i++){
        int count = 0;
        for(int j=0;j<4;j++){
            if(input[i][j] == 0){
                count++;
            }
        }
        switch (count){
            case 0:
                System.out.println("E");
                break;
            case 1:
                System.out.println("A");
                break;
            case 2:
                System.out.println("B");
                break;
            case 3:
                System.out.println("C");
                break;
            case 4:
                System.out.println("D");
                break;
        }
    }
}
profile

make it simple

@keep it simple

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!