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