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 Thousand_Days_on_Earth {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
- LocalDate date = LocalDate.parse(console.nextLine(), formatter);
- String birth = date.format(formatter);
- LocalDate birthDate = LocalDate.parse(birth, formatter);
- LocalDate after1000Days = birthDate.plusDays(999);
- System.out.println(after1000Days.format(formatter));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement