백준 #17009번 Winning Score

jhj·2024년 2월 12일

백준 JAVA

목록 보기
247/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int score3 = sc.nextInt();
		int score2 = sc.nextInt();
		int score1 = sc.nextInt();
		int totalA = score3 * 3 + score2 * 2 + score1;
		
		score3 = sc.nextInt();
		score2 = sc.nextInt();
		score1 = sc.nextInt();
		int totalB = score3 * 3 + score2 * 2 + score1;
		
		if(totalA > totalB) {
			System.out.println("A");
		}else if(totalA < totalB) {
			System.out.println("B");
		}else {
			System.out.println("T");
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글