2021年8月27日
摘要: 1 //srand((unsignedint)time(NULL)); C 2 //获取随机数 10-99 3 4 //int value = (int)(Math.random() * 90+10); //[0.0 - 1.0]-->[0.0,90.0] 5 //( b - a +1) +a 6 阅读全文
posted @ 2021-08-27 22:18 Bytezero! 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 1 /*** 2 * 练习题 3 * 5岁的狗按人的年龄计算的话,前两年每一年是人的 10.5岁,之后每一年 4 * 增加4岁。如果5岁的狗、相当于人的多少年龄 5 * 10.5 + 10.5 + 4 +4 +4=33岁 6 * 7 */ 8 9 System.out.println("请输入狗的年 阅读全文
posted @ 2021-08-27 19:37 Bytezero! 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1 //手动输入3个数,并从小到大排序 2 //import java.util.Sanner; 3 4 System.out.println("请输入第一个数:"); 5 Scanner sc = new Scanner(System.in); 6 int upSort1 = sc.nextInt 阅读全文
posted @ 2021-08-27 19:35 Bytezero! 阅读(991) 评论(0) 推荐(0) 编辑
摘要: 1 //1.引入包名 import java.util.Scanner 2 //2.新建Scanner对象 3 Scanner scan = new Scanner(system.in); 4 //3.调用使用的数据类型 5 int score= scan.nextInt(); 6 7 8 //使用 阅读全文
posted @ 2021-08-27 17:06 Bytezero! 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 1 int aa1 = 11000000; 2 int aa2 = 20000; 3 int aa3 = 6000; 4 5 //第一种 6 int max = (aa1 > aa2)? aa1:aa2; 7 int max1= (max>aa3)? max : aa3; 8 9 System.ou 阅读全文
posted @ 2021-08-27 15:15 Bytezero! 阅读(618) 评论(0) 推荐(0) 编辑
摘要: 1 //交换两个变量的值 2 // 1 3 int nu1 = 10; 4 int nu2 = 20; 5 6 System.out.println("nu1 = "+nu1+"\t"+"nu2 = "+nu2); 7 8 int temp; 9 10 temp = nu1; 11 nu1 = nu 阅读全文
posted @ 2021-08-27 12:45 Bytezero! 阅读(193) 评论(0) 推荐(0) 编辑