Home > Back-end >  Java array rotation problem
Java array rotation problem

Time:10-23

Create a set of array elements to 1 to 12
1 2 3 4 5 6 7 8 9 10 11 12
Now element transformation to
3, 4, 5 and 6 8 8 9 10 11 12 1 2

Party a to replace number with name
Zhang SAN, li si

CodePudding user response:

What do you mean? How do not understand

CodePudding user response:

For example
Int [] a={1,2,3,4,5,6,7,8,9,10,11,12};
Int a0=a [0], a1=a, [1].
for(int i=0; i<10; I++)
A [I]=a, [I + 2].
A [10]=a0;
A, [11]=a1.

CodePudding user response:

Random order?
  • Related