空欄0


String.format()を使用できます.
%02 dは2桁、%04 dは4桁とする.
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String a;
		a = sc.next();
		
		String[] date = a.split("[.]");
		
		int year = Integer.parseInt(date[0]);
		int month = Integer.parseInt(date[1]);
		int day = Integer.parseInt(date[2]);
		
		System.out.println(String.format("%02d-%02d-%04d", day, month, year));	
	}
}