摘要: 1 public class shuzu20{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 //方法使用 6 //1.方法写好后,如果不去调用(使用),不会输出 7 //2.先创建对象,然后调用方法即可 8 Person 阅读全文
posted @ 2024-08-05 10:08 勤奋的小番茄 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1 public class maopao{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 //冒泡排序 6 //要求从小到大 7 //要求从大到小 8 int[] arr = {20, -1, 89, 2, 890, 7} 阅读全文
posted @ 2024-08-03 08:30 勤奋的小番茄 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu19{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /* 5 随机生成10个整数(1-100的范围)保存到数组 6 并倒序打印以及求平均值、求最大值和最大值的下标、 7 并查找里面是否有 阅读全文
posted @ 2024-08-02 11:04 勤奋的小番茄 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu18{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 /* 6 已知有个升序的数组,要求插入一个元素,该数组顺序依然是升序,比如: 7 [10, 12, 45, 90],添加23后,数 阅读全文
posted @ 2024-08-02 10:31 勤奋的小番茄 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu10{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 /* 6 1 7 1 1 8 1 2 1 9 1 3 3 1 10 1 4 6 4 1 11 1 5 10 10 5 1 12 1 阅读全文
posted @ 2024-08-02 09:03 勤奋的小番茄 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu10{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /* 5 int arr[][] = {{4,6},{1,4,5,7},{-2}};遍历该二维数组,并得到和 6 7 8 思路 9 1 阅读全文
posted @ 2024-08-02 08:19 勤奋的小番茄 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu10{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /* 5 请用二维数组输出如下图形 6 0 0 0 0 0 0 7 0 0 1 0 0 0 8 0 2 0 3 0 0 9 0 0 0 阅读全文
posted @ 2024-08-01 08:21 勤奋的小番茄 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu10{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 int[] arr = {24, 69, 80, 57, 13}; 6 7 int temp = 0; 8 for(int i = 阅读全文
posted @ 2024-07-30 10:12 勤奋的小番茄 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu06{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 6 //定义数组 7 int[] arr = {11,22,33,44,55,66}; 8 //思路分析 9 //规律 10 // 阅读全文
posted @ 2024-07-29 09:11 勤奋的小番茄 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1 public class shuzu06{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 5 //将 int[] arr1 ={10,20,30}; 拷贝到 arr2数组, 6 //要求数据空间是独立的。 7 8 int[] 阅读全文
posted @ 2024-07-29 08:49 勤奋的小番茄 阅读(2) 评论(0) 推荐(0) 编辑