摘要: import java.util.Arrays; public class Demo4{ public static void main(String[] args) { int[] a = {1,3,8,10,12}; a = insert(a,11); for (int num :a ) { System.out.print(num+" "); } System.... 阅读全文
posted @ 2018-10-24 18:41 小书虫源 阅读(118) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; public class Demo3 { public static void main(String[] args) { int[] a={1,2,3}; add(a); System.out.println(add[0]; int[] b={4,6,1,9,2}; sort(b); for (int num :array ... 阅读全文
posted @ 2018-10-24 18:34 小书虫源 阅读(206) 评论(0) 推荐(0) 编辑
摘要: * 产生10个随机数5-9之间 统计一个int类型的一维数组中有多少个在[min,max]之间的数 */ import java.util.*; public class Demo{ public static void main(String[] args) { int[] array=getRandom(3,9,-1); iterArray(array); } pub... 阅读全文
posted @ 2018-10-24 17:11 小书虫源 阅读(451) 评论(0) 推荐(0) 编辑
摘要: import java.util.Random; public class Demo1{ public static void main(String[] args) { int[] array = getRandom(3,9,-1); iterArray(array); System.out.println("end..."); } //产生10个随机数5-9之间 //返回... 阅读全文
posted @ 2018-10-24 11:10 小书虫源 阅读(331) 评论(0) 推荐(0) 编辑
摘要: public class H{ public static void main(String[] args) { } //1.设计一个方法,能够找出在两个数组中最大的一个数, //并将其在main方法中打印。 //两个数组分别为{21,54,2,63,87,15,9,50}、{11,100,27,94,56} //返回值类型:int //参数列表:int[] a,int[] ... 阅读全文
posted @ 2018-10-24 10:22 小书虫源 阅读(124) 评论(0) 推荐(0) 编辑