2 Star 0 Fork 0

20165225-牛奶仔/QWQ

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
shiyan1.java 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
20165225-牛奶仔 提交于 2018-04-01 17:29 +08:00 . cai shu zi
import java.util.Random;
import java.util.Scanner;
public class shiyan1 {
public static void main(String[] args) {
Random rd = new Random();
int a = rd.nextInt(20165225);
System.out.println("丞哥说猜数字只能猜0到20165225哦");
Scanner input = new Scanner(System.in);
while (true) {
try {
int b = input.nextInt();
if (b == a) {
System.out.println("天官赐福,百无禁忌!");
break;
} else if (b < a&&b > 0) {
System.out.println("QAQ小了啦");
} else if (b > a&&b < 20165225) {
System.out.println("QAQ大了啦");
}
else System.out.println("丞哥说看了题目还故意打错的都是耍流氓!");
}catch (Exception e) {
System.out.println("大兄弟你在干啥???");
break;
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/nmsl123/QWQ.git
git@gitee.com:nmsl123/QWQ.git
nmsl123
QWQ
QWQ
master

搜索帮助