package cn.tedu.day01;
import java.util.Scanner;
/*
* while循环
* 猜的数字:int num=456;
*条件: int guess;
*while(guess!=num){
*猜数字;
*guess<num;猜小了
*
*}
*/
public class Whilexunhuan {
public static void main(String[] args){
System.out.println("请输入你猜的数字");
Scanner sc=new Scanner(System.in);
int guess=sc.nextInt();
int num=456;
while(guess!=num){
if(guess<num){
System.out.println("猜小了");
}else{
System.out.println("猜大了");
}
System.out.println("继续猜");
guess=sc.nextInt();
}
if(guess==num){
System.out.println("恭喜你猜对了!!!");
}
}
}