//猜数字游戏
import java.util.Scanner;
class MathDemo
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int y = (int)(Math.random()*100+1);
//产生随机数字
//System.out.println(Math.abs(y));
for (int x=0;x<6 ;x++ )
{
int num = sc.nextInt();
if (num<y)
{
System.out.println("你输入的值小于y");
}
else if (num>y)
{
System.out.println("你输入的值大于y");
}
else System.out.println("你输入的值等于y,恭喜了呵呵呵");
}
}
}
|
|