import java.util.Scanner;

public class Main {

	static int[] a_cards = new int[10];
	static int[] b_cards = new int[10];
	static int answer_a = 0;
	static int answer_b = 0;
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner sc = new Scanner(System.in);
		
		for(int i=0;i<10;i++){
			a_cards[i] = sc.nextInt();
		}
		
		for(int i=0;i<10;i++) {
			b_cards[i] = sc.nextInt();
		}
		
		PlayGame();
		
		System.out.println(GetAnswer());
	}
	
	public static void PlayGame(){
		for(int i=0;i<10;i++) {
			if(a_cards[i] > b_cards[i]) {
				answer_a++;
			} else if(a_cards[i] < b_cards[i]) {
				answer_b++;
			}
		}
	}
	
	public static String GetAnswer() {
		if(answer_a > answer_b) return "A";
		else if(answer_b > answer_a) return "B";
		else return "D";
	}
}
반응형

'알고리즘 > Baekjoon' 카테고리의 다른 글

[Baekjoon] #9465 스티커  (0) 2024.04.08
[Baekjoon] #10250 ACM 호텔  (0) 2024.04.08
[Baekjoon] #10809 알파벳 찾기  (0) 2024.04.08
[Baekjoon] #11725 트리의 부모 찾기  (0) 2024.04.08
[Baekjoon] #6359 만취한 상범  (0) 2024.03.08

+ Recent posts