Java/SWEA
[JAVA] SWEA 1936. 1대1 가위바위보
쥬크버그
2024. 5. 1. 18:18
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
정답
import java.util.Scanner;
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)
{
if(B==2)
{
System.out.println("B");
}
else if(B==3)
{
System.out.println("A");
}
}
else if(A==2)
{
if(B==1)
{
System.out.println("A");
}
else if(B==3)
{
System.out.println("B");
}
}
else
{
if(B==1)
{
System.out.println("B");
}
else if(B==2)
{
System.out.println("A");
}
}
}
}