摘要: // 二维数组的获取 int [][] arry4 ={ 0,1,2,3 0 {1,2,3,4}, 1 {4,5,6,7} }; System.out.println(arry4[0][3]); System.out.println(arry4[1][0]); 阅读全文
posted @ 2024-06-12 16:36 GOZO 阅读(12) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { // 判断数组中找元素最大值 int[] Array = {23,12,45,24,10,60,30,2,1}; System.out.println(maxValue(Array)); } public static 阅读全文
posted @ 2024-06-12 16:22 GOZO 阅读(17) 评论(0) 推荐(0)
摘要: Random random = new Random(); int[] number = new int[10]; for (int j = 0; j < 10; j++) {#指定了随机数范围0~100; number[j] = random.nextInt(100); } int sum = 0 阅读全文
posted @ 2024-06-12 16:00 GOZO 阅读(29) 评论(0) 推荐(0)
摘要: Random random = new Random();int result = 1; int i= 1;while (i<=5){ result*=i; i++;}System.out.println(result); 阅读全文
posted @ 2024-06-12 15:57 GOZO 阅读(39) 评论(0) 推荐(0)