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