Import Java.util.Scanner;
Import Java.util.Random;
public class Hello {
public static int judge (int j, int k)
{
int m;
if (j==k) m=0;
else if (j==0&&k==2| | j==1&&k==0| | J==2&&k==1) M=1;
else m=2;
return m;
}
public static void Main (string[] args) {
System.out.println ("scissor (0), Rock (1), paper (2)");
System.out.println ("Please Input Your Choose:");
int a=0,b=0;
Scanner input = new Scanner (system.in);
while (a!=2&&b!=2)
{
int Choose = Input.nextint ();
int number = new Random (). Nextint (3);
if (judge (Choose,number) ==0)
{System.out.println ("tie, please continue competition");
Continue;}
else if (judge (Choose,number) ==1)
{System.out.println ("You win this time,please continue competition");
a++;}
else if (judge (Choose,number) ==2)
{System.out.println ("defeabed This time,please continue competition");
b++;
}
}
if (a==2)
System.out.println ("You Win the Last");
else if (b==2)
SYSTEM.OUT.PRINTLN ("Computer Win last");
}
}
Java applet: and computer scissors