본문 바로가기
JAVA/Coding Test Study

[D1] SWEA - 1936. 1대1 가위바위보 : Java

by ♡˖GYURI˖♡ 2023. 11. 18.
728x90

A가 이기는 경우들만 처리하고 나머지 경우는 else로 묶어 B가 이긴 것으로 했다

 

import java.util.Scanner;
import java.io.FileInputStream;

class Solution
{
	public static void main(String args[]) throws Exception
	{
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		if (A== 1 && B == 3) {
        	    System.out.println("A");
		}
		else if (A == 2 && B == 1) {
		    System.out.println("A");
		}
		else if (A == 3 && B == 2) {
		    System.out.println("A");
		}
		else {
		    System.out.println("B");
		}
	}
}