#2
sillis2023-07-04 02:49
|
我写的是
public static int[] Index() {
int a[] = { 5, 3, 6, 1, 0, 2, 4 };
return a;
}
public static int[] NewIndex() {
int a[] = Index();
int start = 6;
int num = 0;
int b[] = a;
for (int i = 0; i < a.length; i++) {
if (a[i] == start) {
num = i;
}
b[i] = a[(i - num + 7) % 7];
}
return b;
}
结果不对 错在哪里?
[此贴子已经被作者于2023-7-3 20:08编辑过]