代码拉取完成,页面将自动刷新
public static void main(String[] args) throws IOException {
Random a = new Random();
int num = a.nextInt(100);
System.out.println("请输入一个100以内的整数:");
for (int i = 0; i <= 9; i++) {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String str = bf.readLine();
int shu = Integer.parseInt(str);
if (shu > num)
System.out.println("输入的数大了,输小点的dao!");
else if (shu < num)
System.out.println("输入的数小了,输大点的!");
else {
System.out.println("恭喜你,猜对了!");
if (i <= 2)
System.out.println("你真是个天才!");
else if (i <= 6)
System.out.println("还将就,你过关了!");
else if (i <= 8)
System.out.println("但是你还……真笨!");
else
System.out.println("你和猪没有两样了!");
break;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。