Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void roteer(int[] seq) {
- if (seq != null) {
- int temp = seq[seq.length-1];
- for (int i=seq.length-1; i > 0 ; i--) {
- if (i==0) {
- seq[0] = temp;
- }
- else {
- seq[i] = seq[i-1];
- }
- }
- }
- }
- Output with array seq {1,2,3,4,5,6,7,8,9,10}:
- 1 2 3 4 5 6 7 8 9 10
- 1 1 2 3 4 5 6 7 8 9
Add Comment
Please, Sign In to add comment