会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
奋斗的番茄
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2024年8月1日
请用二维数组输出如下图形 0 0 0 0 0 0 ,0 0 1 0 0 0 , 0 2 0 3 0 0 ,0 0 0 0 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 勤奋的小番茄
阅读(27)
评论(0)
推荐(0)
2024年7月30日
使用冒泡排序法,将数组{24, 69, 80, 57, 13}排序
摘要: 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)
2024年7月29日
把数组的元素内容反转 arr = {11,22,33,44,55,66} -->{66,55,44,33,22,11},找规律方法
摘要: 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)
将 int[] arr1 ={10,20,30}; 拷贝到 arr2数组,要求数据空间是独立的。
摘要: 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)
2024年7月28日
请求出一个数组int[]的最大值{4,-1,9,10,23},并得到对应的下标
摘要: 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)
创建一个char类型的26个元素的数组,分别放置'A'-'Z'。
摘要: 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)
2024年7月27日
演示 数据类型 数组名[]=new 数据类型[大小],循环输入5个成绩,保存到double数组,并输出
摘要: 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)
2024年7月26日
菜园里有5只鸡,体重分别是3kg,5kg,1kg,3.4kg,2kg,50kg。求出总体重和平均体重
摘要: 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)+(1+2)+(1+2+3)+(1+2+3+4)+...+(1+2+3+...+100)的结果
摘要: 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-1/2+1/3-1/4..1/100的和
摘要: 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)
上一页
1
2
3
4
5
6
下一页
公告