上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 32 下一页
  2021年8月28日
摘要: 1 //在150之内 是三的倍数 输出Zzz 是5个倍数输出 Lll 是7的倍数输出zlzl 2 int i =1; 3 for(i = 1; i<=150;i++) 4 { 5 System.out.print(i+" "); 6 7 if(i%3==0) 8 { 9 System.out.pri 阅读全文
posted @ 2021-08-28 13:45 Bytezero! 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1 //遍历100以内的偶数,获取所有偶数的和,输出偶数的个数 2 3 int i =1; 4 int sum = 0; 5 int count = 0; 6 for(i = 1;i<=100;i++) 7 { 8 if(i%2==0) 9 { 10 System.out.println(i); 1 阅读全文
posted @ 2021-08-28 10:36 Bytezero! 阅读(1040) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 编写程序: 3 * 从键盘上输入"year"“month”和“day”,要求通过程序输出 4 * 输入的日期为第几年的第几天 5 * 注:判断一年是否是闰年的标准: 6 * 可以被4整除,但不可被100整除 7 * 或 8 * 可以被400整除 9 * 10 */ 11 12 1 阅读全文
posted @ 2021-08-28 10:02 Bytezero! 阅读(747) 评论(0) 推荐(1) 编辑
  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) 编辑
  2021年8月25日
摘要: 1 /*** 2 * 基本数据类型之间的运算规则 3 * 4 * 前提:7中基本数据类型运算 5 * 6 * 1.自动类型提升: 7 * 当容量小的类型与容量大的数据类型的变量做运算时,结果自动提升为容量大的数据类型 8 * byte、char、short->int->long->float->do 阅读全文
posted @ 2021-08-25 12:21 Bytezero! 阅读(101) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 32 下一页