import java.util.Scanner;
class Gem {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入数字");
int b = (int)(Math.random() * 100) + 1;
int count = 0;
while (true) {
int a = sc.nextInt();
if (a > b) {
System.out.println("大了");
}else if (a < b) {
System.out.println("小了");
}else if (a == b) {
System.out.println("中了");
break;
}
count++;
}
System.out.println("你的智商是"+(100 - count));
}
}
|
|