Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9. String numbers = scanner.nextLine();
  10.  
  11. char one = numbers.charAt(0);
  12. char two = numbers.charAt(1);
  13. char three = numbers.charAt(2);
  14. char four = numbers.charAt(3);
  15.  
  16. int count = 0;
  17. int i = 0;
  18. int j = 0;
  19. int k = 0;
  20. int l = 0;
  21. while (count < numbers.length()) {
  22. four = numbers.charAt(3 + i);
  23. i = i -3 ;
  24. three = numbers.charAt(2 + j);
  25. j = j + 1;
  26. two = numbers.charAt(1 + k);
  27. k = k + 1;
  28. one = numbers.charAt(0 + l);
  29. l = l + 1;
  30.  
  31.  
  32.  
  33. System.out.printf("%c%c%c%c%n", one, two, three, four);
  34. count++;
  35. String newOne =
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement