public class HelloWorld { public static void main(String[] args) { // 定義一個整型數組,并賦初值 int[] nums = new int[] { 61, 23, 4, 74, 13, 148, 20 }; int max = nums[0]; // 假定最大值為數組中的第一個元素 int min = nums[0]; // 假定最小值為數組中的第一個元素 dou
public class HelloWorld { public static void main(String[] args) { // 定義一個整型數組,并賦初值 int[] nums = new int[] { 61, 23, 4, 74, 13, 148, 20 }; int max = nums[0]; // 假定最大值為數組中的第一個元素 int min = nums[0]; // 假定最小值為數組中的第一個元素 dou
2021-01-14
public?class?HelloWorld?{ ????public?static?void?main(String[]?args)?{ ????int[]?nums?=new?int[]{61,23,4,74,13,148,20}; ????int?max?=?nums[0]; ????int?min?=?nums[0]; ?????} ????}2020-10-18
沒錯啊? 除了少了兩個大括號
2020-10-06
同時定義同一個元素應該不行的