public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] a = new int[6]; for (int i = 1; i <= 6; i++) { if (scanner.hasNextInt()) { a[i - 1] = scanner.nextInt(); } } for (int array : a) { System.out.print(array); System.out.println(); } int[] b = new int[6]; for (int i = 1; i <= 6; i++) { b[b.length - i] = a[i - 1]; } for (int array : b) { System.out.print(array); } }
数组倒转(*-*)
最新推荐文章于 2024-11-04 22:26:34 发布