SWEA
[SWEA] 1대1 가위바위보
itsnot4me
2024. 9. 20. 17:53
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
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)|| (A==2&&B==1)|| (A==3&&B==2))
System.out.print("A");
else
System.out.print("B");
}
}
논리 연산자를 이용하면 되는 문제