mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
style:fmt
This commit is contained in:
@@ -3,20 +3,20 @@ package com.study.demo;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class test3_1 {
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
int n = scanner.nextInt();
|
||||
int[] arr = new int[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
arr[i] = scanner.nextInt();
|
||||
}
|
||||
for (int i = 0; i < n / 2; i++) {
|
||||
int temp = arr[i];
|
||||
arr[i] = arr[n - 1 - i];
|
||||
arr[n - 1 - i] = temp;
|
||||
}
|
||||
for (int i = 0; i < n; i++) {
|
||||
System.out.print(arr[i] + (i == n - 1 ? "" : " "));
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
int n = scanner.nextInt();
|
||||
int[] arr = new int[n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
arr[i] = scanner.nextInt();
|
||||
}
|
||||
for (int i = 0; i < n / 2; i++) {
|
||||
int temp = arr[i];
|
||||
arr[i] = arr[n - 1 - i];
|
||||
arr[n - 1 - i] = temp;
|
||||
}
|
||||
for (int i = 0; i < n; i++) {
|
||||
System.out.print(arr[i] + (i == n - 1 ? "" : " "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user