1 1 1 1 모
1 1 1 0 도
1 1 0 0 개
1 0 0 0 걸
0 0 0 0 윷
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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]); | |
} | |
} |
1이 나올때마다 count에 --해줘서 character형 배열에서 뽑아 쓰는식으로 했다.
'IT > 알고리즘' 카테고리의 다른 글
BOJ 백준온라인져지 6588 골드바흐의 추측 풀이 (0) | 2017.12.06 |
---|---|
BOJ 백준온라인져지 2960 에라토스테네스의 체 풀이 (0) | 2017.12.06 |
BOJ 백준온라인져지 10872 팩토리얼 풀이 (0) | 2017.12.05 |
BOJ 백준온라인져지 1037 약수 풀이 (0) | 2017.12.05 |
BOJ 백준온라인져지 2163 초콜릿 자르기 풀이 (0) | 2017.12.05 |