Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.time.LocalDate;
- import java.time.format.DateTimeFormatter;
- import java.util.Scanner;
- public class ThousandDaysAfterBirth {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- String birth = console.nextLine();
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
- LocalDate date = LocalDate.parse(birth, formatter);
- date = date.plusDays(999);
- System.out.println(formatter.format(date));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement