package com.itheima.caishuzi;
import java.util.Random;
import java.util.Scanner;
public class CaiShuZi {
public static void main(String[] args) {
Random ra=new Random();
int num = ra.nextInt(1000);
Scanner sc=new Scanner(System.in);
System.out.println("请输入一个数字:");
int number = sc.nextInt();
//作弊神器
if(number==666){
System.out.println("作弊神器,这个数是:"+num);
}else if(number>num){
System.out.println("你输入的数字大了,请重新输入!");
}else if(number<num){
System.out.println("你输入的数字小了,请重新输入!");
}else if(number==num){
System.out.println("恭喜你,猜对了!");
}
}
}
|
|