- #1
TheSourceCode
- 14
- 0
Use nested for loops to produce the following pattern of cyclic permutations of the English
alphabet:
abcde...yz
bcdef...za
cdef...zab
...
zabcde...xy
HINT: you may find the modulo (remainder) operator % useful.
I have an idea of how to do this but it would not use the modulo operator. I thought of saving the first letter of an array into a variable, shifting everything else down one and putting it at the end. This also would only implement a single for loop. Any clues would be greatly appreciated.
alphabet:
abcde...yz
bcdef...za
cdef...zab
...
zabcde...xy
HINT: you may find the modulo (remainder) operator % useful.
I have an idea of how to do this but it would not use the modulo operator. I thought of saving the first letter of an array into a variable, shifting everything else down one and putting it at the end. This also would only implement a single for loop. Any clues would be greatly appreciated.