摘要: 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 勤奋的小番茄 阅读(5) 评论(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 勤奋的小番茄 阅读(29) 评论(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 勤奋的小番茄 阅读(5) 评论(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 勤奋的小番茄 阅读(6) 评论(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 勤奋的小番茄 阅读(10) 评论(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 勤奋的小番茄 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 1 public class exercise08{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /*输出1-100之间的不能被5整除的数,每5个一行 5 6 思路分析 7 1.先输出1-100的所有数 8 2.然后过滤输出不 阅读全文
posted @ 2024-07-25 08:32 勤奋的小番茄 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 1 public class exercise08{ 2 //编写一个main方法 3 public static void main(String[] args){ 4 /* 5 4.判断一个整数是否是水仙花数,所谓的水仙花数是指一个3位数, 6 其各个位上数字立方和等于其本身。 7 例如: 15 阅读全文
posted @ 2024-07-25 08:07 勤奋的小番茄 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 1 public class exercise08{ 2 //编写一个main方法 3 public static void main(){ 4 /* 5 某人有100,0000元,每经过一次路口,需要交费,规则如下: 6 1)当现金>50000时,每次交5% 7 2)当现金<=50000时,每次交 阅读全文
posted @ 2024-07-24 11:07 勤奋的小番茄 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.Scanner; 2 public class exercise06{ 3 //编写一个main方法 4 public static void main(String[] args){ 5 6 //实现登录验证,有3次机会,如果用户名为“丁真”,密码为“666” 阅读全文
posted @ 2024-07-23 10:24 勤奋的小番茄 阅读(11) 评论(0) 推荐(0) 编辑