猜数字
来源:互联网 发布:linux spi驱动移植 编辑:程序博客网 时间:2024/05/29 14:42
import java.util.Scanner;public class CaiShu {public static void main(String[] args) {//设置1到100随机数int num = (int)(Math.random() * 100 + 1); while(true){Scanner scanner = new Scanner(System.in);int i = scanner.nextInt();if (i > num){System.out.println("大了");}else if(i < num){System.out.println("小了");}else if(i == num){System.out.println("正确");break; //结束}}}}
0 0
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 猜数字
- 远征大宛
- (0829)BOM对象-location-screen-history-navigat、DOM对象-htmlDOM-cssDOM
- Redis windows学习(一)——redis安装和基础使用
- 隐马尔科夫模型(Hidden Markov Models)
- linux shell (二)正则表达式
- 猜数字
- 解决hibernate向mysql插入中文乱码
- Android使用Gson解析JSON格式
- NOI2015 后记
- a point worth noting is that 的理解
- 整人
- [Android随笔]BroadcastReceiver广播机制
- Android APK调用mongoose
- WAMPServer集成环境安装