有没有能实现这种的: 1 2 3 4 8 7 6 5 9 10 11 12 .....
有没有能实现这种排序的:
1 2 3 4
8 7 6 5
9 10 11 12
.....
[解决办法]
int count = 1; for (int i = 0; i < a.Length; i += 4) { if (count % 2 == 0) { swap(ref a[i], ref a[i + 3]); swap(ref a[i + 1], ref a[i + 2]); } count++; }