慕容4345310
public class TestFor {public boolean isEqual(int[] arr1, int[] arr2) {
if (arr1.length != arr2.length)
return false;
else {
boolean flag1 = true;
boolean flag2 = true;
for (int i = 0; i
if (arr1[i] != arr2[i]) {
flag1 = false;
}
}
if (!flag1) {
for (int i = 0; i
if (arr1[i] != arr2[arr1.length-1-i]) {
flag2 = false;
}
}
}
return flag1 || flag2;
}
}
public static void main(String[] args) {
int arr1[] = { 1, 2, 3, 4 };
int arr2[] = { 4, 3, 2, 1 };
TestFor tf = new TestFor();
System.out.println(tf.isEqual(arr1, arr2));
}
}