丶包菜
不知我有没有看懂题
public static void main(String[] args) {
int[] arr = new int[]{1, 2, 3, 4};
//int sum=0;
int temp;
for (int i = 0, size = arr.length; i < size; i++) {
arr[i] += 5;
//sum+=arr[i];
}
temp = arr[0] % 10;
arr[0] = arr[3] % 10;
arr[3] = temp;
temp = arr[1] % 10;
arr[1] = arr[2] % 10;
arr[2] = temp;
System.out.println(Arrays.toString(arr));//9,8,7,6
}