알고리즘

[알고리즘] 백준 10801 - 카드게임 (C++)

blueberrysoda 2024. 9. 29. 23:35

[문제 링크] : https://www.acmicpc.net/problem/10801

#include <iostream>
using namespace std;

int A[11], B[11];

int main(){
    int a = 0, b = 0;

    for(int i=0; i<10; i++){
        cin >> A[i];
    }

    for(int i=0; i<10; i++){
        cin >> B[i];
    }

    for(int i=0; i<10; i++){
        if(A[i] > B[i]){
            a++;
        }
        else if(A[i] < B[i]){
            b++;
        }
    }

    if(a > b){
        cout << "A\n";
    }
    else if(b > a){
        cout << "B\n";
    }
    else {
        cout << "D\n";
    }
    return 0;
}