Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GenerateAllRotation {
- public static void main(String[] args) {
- generateRotation(1445);
- }
- private static int len(int num){
- int count=0;
- while (num >0){
- count++;
- num/=10;
- }
- return count;
- }
- private static void generateRotation(int number){
- int len = len(number)-1;
- while (len>0){
- int x = (int) (number%Math.pow(10,len));
- int y = (int) (number/Math.pow(10,len));
- System.out.println(String.valueOf(x)+String.valueOf(y));
- len--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement