题解 | 斗兽棋
斗兽棋
https://www.nowcoder.com/practice/0b5afb815f6848d9a7f9c1b0ce514b95
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String a = in.next();
String b = in.next();
//System.out.println(a.equals(""));
if ((a.equals("elephant") && b.equals("tiger")) || (a.equals("tiger") &&
b.equals("cat") ) ||
(a.equals("cat") && b.equals("mouse") ) || (a.equals("mouse") &&
b.equals("elephant"))) {
System.out.println("win");
} else if ((b.equals("elephant") && a.equals("tiger")) || (b.equals("tiger") &&
a.equals("cat") ) ||
(b.equals("cat") && a.equals("mouse") ) || (b.equals("mouse") &&
a.equals("elephant"))) {
System.out.println("lose");
} else {
System.out.println("tie");
}
}
}
史山

