Advertisement
Guest User

BdayPlus1000

a guest
Apr 25th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import javax.swing.text.DateFormatter;
  2. import java.time.LocalDate;
  3. import java.time.format.DateTimeFormatter;
  4. import java.util.Scanner;
  5.  
  6. public class HundredDaysAfterBirth {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scanner = new Scanner(System.in);
  10.         String date = scanner.nextLine();
  11.  
  12.         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
  13.         LocalDate date1 = LocalDate.parse(date, formatter);//.plusDays(999);
  14.         LocalDate hundred = date1.plusDays(999);
  15.  
  16.         System.out.println(formatter.format(hundred));
  17.  
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement