import java.util.Scanner;
class Test1_GuessNum {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个1~100之间的整数:");
int guessNum = (int) (Math.random() * 100 + 1);
int count = 0;
while(true) {
int result = sc.nextInt();
if(result < 1 || result >100) {
System.out.println("你逗比么? 没看到只能在1~100之间么?");
} else if(result > guessNum){
System.out.println("你不感觉有点大?");
} else if(result < guessNum){
System.out.println("是不是有点小?");
} else {
System.out.println("这才对么~~~");
break;
}
count++;
}
if( count == 1) {
System.out.println("你真是叼炸天了~~~");
}else if (count <= 10) {
System.out.println("你智商也就80了~~");
}else if(count > 10) {
System.out.println("地球太危险,你可以回火星了~~~");
}
}
}
|
|