반응형
쉬움 문제선택잘못함
#include < iostream > using namespace std; // 도 0 1 1 1 -> A 1 // 개 0 0 1 1 -> B 2 // 걸 0 0 0 1 -> C 3 // 윳 0 0 0 0 -> D 4 // 모 1 1 1 1 -> E 0 int main() { for (int i = 0; i < 3; i++) { // 3줄 입력받기 int num = 0; for (int j = 0; j < 4; j++) { // 윷 4개 입력받기 int temp; cin >> temp; if (temp==0) { // 0의 갯수 세기 num++; } } // 출력 switch (num) { case 1: cout << 'A' << endl; break; case 2: cout << 'B' << endl; break; case 3: cout << 'C' << endl; break; case 4: cout << 'D' << endl; break; case 0: cout << 'E' << endl; break; } } return 0; }
반응형