For this Question: Peter has the task to write a program that processes N strings. Some of them have Russian and European format "day.month.year", while others use American format — "month/day/year".
Here, year is a number from 1 to 9999, which may contain leading zeroes to get 2, 3 or 4 digits, month — number from 1 to 12, which may contain leading zero to get 2 digits, day — number from 1 to 31, which may contain leading zeros to get 2 digits.
Print each date in two formats: first as "DD.MM.YYYY', second as "MM/DD/YYYY".
For better understanding see sample.The first line of input contains one integer N (1 <= N  <= 100).

Each of the following N lines contain one date in format "day.month.year" or "month/day/year".Print 𝑛 lines. Each line should contain the date in two formats: first as "DD.MM.YYYY", second as "MM/DD/YYYY".Sample Input
2
11.12.2000
1.2.1

Sample Output
11.12.2000 12/11/2000
01.02.0001 02/01/0001

Sample Input
2
20.10.2100
1/29/3000

Sample Output
20.10.2100 10/20/2100
29.01.3000 01/29/3000, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {
                    Scanner scanner = new Scanner(System.in);
                    int tc= scanner.nextInt();
                    for(int i=0;i<tc;i++){
                        String s=scanner.next();
                        if(s.indexOf(".")==-1){
                             String[] str=s.split("/");
                             printOut1(str);
                        }else{
                            String[] str=s.split("[.]");
                        printOut(str);
                        }
                        System.out.println();

                    }
	}
    public static void printOut(String str[]){
        if(str[0].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[0]);
        System.out.print(".");
        if(str[1].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[1]);
        System.out.print(".");
        for(int i=0;i<4-str[2].length();i++){
            System.out.print("0");
        }
        System.out.print(str[2]);

        System.out.print(" ");
        if(str[1].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[1]);
        System.out.print("/");
        if(str[0].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[0]);
        System.out.print("/");
        for(int i=0;i<4-str[2].length();i++){
            System.out.print("0");
        }
        System.out.print(str[2]);
    }




    public static void printOut1(String str[]){
        if(str[1].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[1]);
        System.out.print(".");
        if(str[0].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[0]);
        System.out.print(".");
        for(int i=0;i<4-str[2].length();i++){
            System.out.print("0");
        }
        System.out.print(str[2]);

        System.out.print(" ");
        if(str[0].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[0]);
        System.out.print("/");
        if(str[1].length()!=2){
            System.out.print("0");
        }
        System.out.print(str[1]);
        System.out.print("/");
        for(int i=0;i<4-str[2].length();i++){
            System.out.print("0");
        }
        System.out.print(str[2]);
    }

}, In this Programming Language: Java, Now tell me if this Code is compilable or not?