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 DateAfterBirth {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- DateTimeFormatter df = DateTimeFormatter.ofPattern("dd-MM-yyyy");
- try {
- LocalDate date = LocalDate.parse(console.nextLine(), df);
- System.out.println(df.format(date.plusDays(999)));
- } catch (Exception e) {
- System.out.println("You are an idiot");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment