Package com;
Import Java.util.Scanner;
public class Zixue007 {
public static void Main (string[] args) {
int b= (int) (Math.random () *10+1);
System.out.println (b);
Scanner input=new Scanner (system.in);
System.out.println ("Please enter a number within 1 to 10:");
int A=input.nextint ();
int i = 1;
int sum=0;
while (A!=b & i<10) {
System.out.println (a>b? ") Sorry: Big ":" Very sorry: small ");
System.out.println ("Please enter the Guess number again:");
A=input.nextint ();
i++;
sum++;
}
String s = "";
if (i<5) {
S= "You guessed right, the good, haha ha!" ";
}else if (i<9) {
S= "You guessed right, good grades";
}else s= "10 times can not guess the pig one";
System.out.println ("Congratulations on the correct number!") The "+" answer is: "+b+". You have guessed the "+i+" time. "
+ "The system evaluates you:" +s);
}
}
Guess the game with Java!