Home > Back-end > The teacher told us to design a guess game. I designed, but can't run, don't know why ask
The teacher told us to design a guess game. I designed, but can't run, don't know why ask
Time:10-10
import java.util.Scanner;
Public class youxi {
Public static void main (String [] args) { Int daan=66; System. Out.println (" hey, q, we today to play a number of guessing game, you guess according to I provide the scope of the ha, guessed prize!" ); System. The out. Println (" hey hey, that,, you just guess a number first, "); Scanner m=new Scanner (System. In); If (m & gt; Daan) { System. Out.println (" your mama a silly, you guess! Guess again!" ); } Else if (m & lt; Daan) { System. Out.println (" you are a silly carving, you he niang small guess, guess again!" ); } The else { System. Out.println (" oh my god, this young man, you guessed it! You he niang is a genius, come on, labor reward you two slap in the face!" ); } } While (daan!=66);
}
CodePudding user response:
Your code changes, note into circulation conditions, remember junction post
Public static void main (String [] args) { Int daan=66; System. Out.println (" hey, q, we today to play a number of guessing game, you guess according to I provide the scope of the ha, guessed prize!" ); System. The out. Println (" hey hey, that,, you just guess a number first, "); Scanner scan=new Scanner (System. In); Int m=0; While (m! Daan)={ M=scan nextInt (); If (m & gt; Daan) { System. Out.println (" your mama a silly, you guess! Guess again!" ); } else if (m & lt; Daan) { System. Out.println (" you are a silly carving, you he niang small guess, guess again!" ); } else { System. Out.println (" oh my god, this young man, you guessed it! You he niang is a genius, come on, labor reward you two slap in the face!" ); } } }