String[] hand = {"가위", "바위", "보"};
int a = 1;
int b = 2;
if(a == b) {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 무승부");
} else if((a == 0 && b == 2) || (a == 1 && b == 0) || (a == 2 && b == 1)) {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 승리");
} else {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 패배");
}
========================================================================================
String[] hand = {"가위", "바위", "보"};
int a = 0;
int b = 1;
if(a == b) {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 무승부");
} else if((a + 2) % 3 == b) {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 승리");
} else {
System.out.println("user>" + hand[a] + " comm>" + hand[b] + " 패배");
}