摘要: 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 勤奋的小番茄 阅读(27) 评论(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 勤奋的小番茄 阅读(19) 评论(1) 推荐(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 勤奋的小番茄 阅读(28) 评论(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 勤奋的小番茄 阅读(21) 评论(0) 推荐(0)
摘要: public class shuzu05{ //编写一个main方法 public static void main(String[] args){ //请求出一个数组int[]的最大值{4,-1,9,10,23},并得到对应的下标 //思路分析 //1.定义一个int 数组 int[] arr = 阅读全文
posted @ 2024-07-28 08:39 勤奋的小番茄 阅读(36) 评论(0) 推荐(0)
摘要: public class shuzu03{ //编写一个main方法 public static void main(String[] args){ /* 创建一个char类型的26个元素的数组,分别放置'A'-'Z'。 使用for循环访问所有元素并打印出来。 提示:char类型数据运算'A' + 阅读全文
posted @ 2024-07-28 08:04 勤奋的小番茄 阅读(140) 评论(0) 推荐(0)
摘要: import java.util.Scanner; public class exercise13{ //编写一个main方法 public static void main(String[] args){ //演示 数据类型 数组名[]=new 数据类型[大小] //循环输入5个成绩,保存到dou 阅读全文
posted @ 2024-07-27 09:30 勤奋的小番茄 阅读(27) 评论(0) 推荐(0)
摘要: 1 public class exercise13{ 2 3 public static void main(String[] args){ 4 //比如,我们可以用数组来解决一个问题 => 体验 5 //定义一个数组 6 //解读 7 //1.double[] 表示是 double类型的数组,数组 阅读全文
posted @ 2024-07-26 09:40 勤奋的小番茄 阅读(24) 评论(1) 推荐(0)
摘要: 1 public class exercise08{ 2 //编写一个main方法 3 public static void main(string[] args){ 4 //求(1)+(1+2)+(1+2+3)+(1+2+3+4)+...+(1+2+3+...+100)的结果 5 // 6 //思 阅读全文
posted @ 2024-07-26 08:00 勤奋的小番茄 阅读(39) 评论(0) 推荐(0)
摘要: 1 public class exercise08{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /* 5 求出1-1/2+1/3-1/4..1/100的和 6 思路分析 7 1. 1-1/2+1/3-1/4...1/100 阅读全文
posted @ 2024-07-26 07:44 勤奋的小番茄 阅读(144) 评论(0) 推荐(0)