728x90

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 <bits/stdc++.h> | |
using namespace std; | |
int main(void) { | |
ios::sync_with_stdio(false), cin.tie(nullptr); | |
for (int i = 0; i < 3; i++) { | |
int num, sum = 0; | |
for (int j = 0; j < 4; j++) { | |
cin >> num, sum += num; | |
} | |
switch (sum) { | |
case 0: | |
cout << 'D'; // 윷 | |
break; | |
case 1: | |
cout << 'C'; // 걸 | |
break; | |
case 2: | |
cout << 'B'; // 개 | |
break; | |
case 3: | |
cout << 'A'; // 도 | |
break; | |
case 4: | |
cout << 'E'; // 모 | |
break; | |
defalut: | |
break; | |
} | |
cout << '\n'; | |
} | |
} | |
// Authored by : wogha95 | |
// Co-authored by : BaaaaaaaaaaarkingDog | |
// http://boj.kr/38cf0450b8c8458e859c486e3ea80323 | |
// #include <bits/stdc++.h> | |
// using namespace std; | |
// int result, input; | |
// string res = "DCBAE"; | |
// int main(void) { | |
// ios::sync_with_stdio(0); | |
// cin.tie(0); | |
// for (int r = 0; r < 3; r++) { | |
// result = 0; | |
// for (int c = 0; c < 4; c++) { | |
// cin >> input; | |
// result += input; | |
// } | |
// cout << res[result] << '\n'; | |
// } | |
// } |
'Algorithm > C&C++' 카테고리의 다른 글
백준 2576번: 홀수(c/c++, c/cpp) (0) | 2021.10.05 |
---|---|
백준 2562번: 최댓값(c/c++, c/cpp) (0) | 2021.10.05 |
백준 2480번: 주사위 세개(c/c++, c/cpp) (0) | 2021.09.29 |
백준 2753번: 윤년(c++) (0) | 2021.09.29 |
백준 1000번: A+B(c++) (0) | 2021.09.27 |