import java.util.Scanner;
public class text {
public static void main(String[] args) {
int k = 1;
game you = new game();
do {
System.out.println("猜拳游戏现在开始" + "\n" + "输入 0 :石头 1 :剪刀 2 :布");
you.hanshu();
System.out.println("是否继续游戏? 1 : 继续 2 : 关闭");
Scanner sc = new Scanner(System.in);
k = sc.nextInt();
} while (k == 1);
System.out.println("游戏结束你共赢了 " + you.i + " 次");
}
static class game {
int i = 0;
public void hanshu() {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
if (n == 0) {
System.out.print("你出石头");
} else if (n == 1) {
System.out.print("你出剪刀");
} else {
System.out.print("你出布");
}
int x = 0 + (int) (Math.random() * 2);
if (x == 0) {
System.out.println("VS电脑出石头");
} else if (x == 1) {
System.out.println("VS电脑出剪刀");
} else {
System.out.println("VS电脑出布");
}
if ((n == 0 && x == 1) || (n == 1 && x == 2) || (n == 2 && x == 0)) {
System.out.println("你赢了");
i++;
} else if (n == x) {
System.out.println("打平");
} else {
System.out.println("电脑赢了");
}
}
}
}