摘要: public class ArraysDemo02 { public static void main(String[] args) { int[][] a = new int[11][11]; a[1][2] = 1; a[2][3] = 2; for (int[] ints : a) { for 阅读全文
posted @ 2024-09-22 20:12 jyp2241109 阅读(12) 评论(0) 推荐(0)
摘要: public class ArraysDemo01 { public static void main(String[] args) { //冒泡排序 //比较数组中,两个相邻的元素,如果第一个比第二个数大,调换位置 //每一次比较,都会产生一个最大或者最小的数 //下一轮可以少一次排序 int a 阅读全文
posted @ 2024-09-22 18:47 jyp2241109 阅读(18) 评论(0) 推荐(0)
摘要: public class Demo04 { public static void main(String[] args) { //我们要输入多个数字并且要求出总和与平均数,每输入一个数字用回车确认,通过输入非数字来结束输入并且执行输出结果 Scanner sc = new Scanner(Syste 阅读全文
posted @ 2024-09-17 22:12 jyp2241109 阅读(25) 评论(0) 推荐(0)
摘要: package com.p.www.Num; public class num1 { public static void main(String[] args) { int i=128; byte b=(byte) i; //强制转换 高到低。若是低到高,则自动转换 System.out.prin 阅读全文
posted @ 2024-09-17 20:57 jyp2241109 阅读(6) 评论(0) 推荐(0)