猜数字
import java.util.Scanner;
public class Guess{
public static void main(String[] args){
int x = (int)(Math.random()*10);//从0~9中随机生成一个数
Scanner in = new Scanner(System.in);
int input = in.nextInt();//玩家输入
if(input == x)
System.out.println("correct!");//答对
else
System.out.println("incorrect!");//答错
}
}