Import Java.util.random;import Java.util.scanner;public class Caiquan{public static void Main (string[] args) {Random r= New Random (); int Diannao=r.nextint (3) +1; Scanner s=new Scanner (system.in); System.out.println ("========= scissors mini-game ========="); System.out.println ("Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth"); int fangke=s.nextint (); if (diannao==1&&fangke==1) { SYSTEM.OUT.PRINTLN ("The computer is a pair of scissors, you have scissors, a draw");} if (diannao==1&&fangke==2) {System.out.println ("The computer out of the scissors, you out of the stone, you Win");} if (diannao==1&&fangke==3) {System.out.println ("The computer out of the scissors, you out of the cloth, the computer wins");} if (diannao==2&&fangke==1) {System.out.println ("The computer is out of stone, you have scissors, the computer Wins");} if (diannao==2&&fangke==2) {System.out.println ("The computer is out of stone, you have a stone, a draw");} if (diannao==2&&fangke==3) {System.out.println ("The computer is out of stone, you are out of cloth, you Win");} if (diannao==3&&fangke==1) {System.out.println ("The computer out of the cloth, you out of the scissors, you Win");} if (diannao==3&&fangke==2) {System.out.println ("The computer out of the cloth, you out of the stone, the computer Wins");} if (diannao==3&&fangke==3) {System.out.println ("The computer is out of cloth, you are out of cloth, Draw");} if (FANGKE!=1&Amp;&fangke!=2&&fangke!=3) {System.out.println ("can only enter 1, 2, 3");}}}
=============================================
C:\Documents and Settings\administrator>d:
D:\>CD JAVACX
D:\javacx>javac Caiquan.java
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
1
The computer out of the stone, you out of the scissors, the computer won
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
1
The computer out of the stone, you out of the scissors, the computer won
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
1
The computer out of the stone, you out of the scissors, the computer won
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
1
The computer is scissors, you have scissors, draw
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
1
The computer out is the cloth, you out of the scissors, you win
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
2
The computer out is the scissors, you out of the stone, you win
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
3
The computer out is the stone, you out of the cloth, you win
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
2
The computer is a stone, you have a rock, a draw.
D:\javacx>java Caiquan
========= Scissors Mini Game =========
Please enter 1, 2, 3, 1 for scissors, 2 for stone, 3 for cloth
8
You can only enter 1, 2, 3
D:\javacx>
Java Scissors mini-game (scissors, stone, cloth)