public static void main(String[] args) { int zxc =10; int[] arr=new int[zxc]; Scanner scanner =new Scanner(System.in); for (int i = 0; i < arr.length; i++) { System.out.println("请输入第"+(i+1)+"个数组"); arr[i]=scanner.nextInt(); } System.out.println(Arrays.toString(arr)); for (int z = 0; z < arr.length; z++) { if (z%2==0){ System.out.print(arr[z]+" "); } }
04-22
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-07
2005
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-17
8175
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)