Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String numbers = scanner.nextLine();
- char one = numbers.charAt(0);
- char two = numbers.charAt(1);
- char three = numbers.charAt(2);
- char four = numbers.charAt(3);
- int count = 0;
- int i = 0;
- int j = 0;
- int k = 0;
- int l = 0;
- while (count < numbers.length()) {
- four = numbers.charAt(3 + i);
- i = i -3 ;
- three = numbers.charAt(2 + j);
- j = j + 1;
- two = numbers.charAt(1 + k);
- k = k + 1;
- one = numbers.charAt(0 + l);
- l = l + 1;
- System.out.printf("%c%c%c%c%n", one, two, three, four);
- count++;
- String newOne =
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement