1 1 1 1    모

1 1 1 0    도

1 1 0 0    개

1 0 0 0    걸

0 0 0 0    윷


#include <cstdio>
/**
* https://www.acmicpc.net/problem/2490
* BOJ 백준온라인져지 2490 윷놀이 풀이
*/
char arr[5] = {'E', 'A', 'B', 'C', 'D'};
int main(){
for(int i = 0; i<3; i++){
int count = 4;
for(int j = 0; j<4; j++){
int temp;
scanf("%d", &temp);
count -= temp;
}
printf("%c\n", arr[count]);
}
}
view raw BOJ_2490.cpp hosted with ❤ by GitHub

1이 나올때마다 count에 --해줘서 character형 배열에서 뽑아 쓰는식으로 했다.

+ Recent posts