上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 65 下一页
摘要: package com.fqs.demo; public class ZhiNumber { public static int count_zhi = 0; public static void main(String[] args) { //计算1到10之间的质数 int start=101;/ 阅读全文
posted @ 2023-01-17 22:53 胖豆芽 阅读(16) 评论(1) 推荐(0) 编辑
摘要: package com.fqs.demo; public class fangArray { public static void main(String[] args) { //将100到105的数放数组中 int a=100;//开始的值 包含自身 int b=105;//结束的值 包含自身 i 阅读全文
posted @ 2023-01-17 21:17 胖豆芽 阅读(23) 评论(0) 推荐(0) 编辑
摘要: package com.fqs.demo; public class ZhiNumber { public static void main(String[] args) { //计算某个数是否是质数 能被1和自身除时余数为0 ;被其他数除余数不等于0 int number=4; int count 阅读全文
posted @ 2023-01-17 21:05 胖豆芽 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 将1到10,10个数放到一个数组中 package com.fqs.demo; public class fangArray { public static void main(String[] args) { //将1到10的数放数组中 int array[]= new int[10] ;//定义 阅读全文
posted @ 2023-01-17 21:04 胖豆芽 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 自己写的求质数 package com.fqs.demo; public class ZhiNumber { public static void main(String[] args) { //计算7是否是质数 能被1和自身除时余数为0 ;被其他数除余数不等于0 int number=8; int 阅读全文
posted @ 2023-01-16 23:15 胖豆芽 阅读(14) 评论(0) 推荐(0) 编辑
摘要: package com.fqs.demo; import java.util.Scanner; public class ChongZ { /*\\5-10月份属于旺季 机票原价100或任何你想输入的值,头等舱的价格 9折 ;经济舱的价格 8.5折 \\11月份12月 1,2,3的4月份 属于淡季 阅读全文
posted @ 2023-01-16 21:31 胖豆芽 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 改进后 加了 不合法输入后,提示再次输入 package com.fqs.demo; import java.util.Scanner; public class ChongZ { /*\\5-10月份属于旺季 机票原价100,头等舱的价格 9折 ;经济舱的价格 8.5折 \\11月份12月 1,2 阅读全文
posted @ 2023-01-15 21:21 胖豆芽 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 第一步理解while循环 package com.fqs.demo; public class WrongDemo2 { public static void main(String[] args) { int i=0; while(i<3) { i++; System.out.println("i 阅读全文
posted @ 2023-01-15 21:06 胖豆芽 阅读(44) 评论(0) 推荐(0) 编辑
摘要: package com.fqs.demo; import java.util.Arrays; public class ChongZ { //复制数组,定义一个方法copyofRange(int[]arr,int from,int to) //将数组arr中从索引from(包含from)开始, // 阅读全文
posted @ 2023-01-15 17:03 胖豆芽 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 正确答案 有一次则正确flag=true; 循环都不相等,在for循环最外面,说明flag=false package com.fqs.demo; import java.util.Scanner; public class ChongZ { //定义一个方法 判断数组中的某个数是否存在 将结果返回 阅读全文
posted @ 2023-01-15 16:05 胖豆芽 阅读(106) 评论(0) 推荐(0) 编辑
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 65 下一页