martinvalchev

1000 Days After Birth

Oct 17th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.time.LocalDate;
  2. import java.time.format.DateTimeFormatter;
  3. import java.util.Scanner;
  4.  
  5. public class DaysAfterBirth {
  6.     public static void main (String [] args) {
  7.         Scanner console = new Scanner(System.in);
  8.         LocalDate input = LocalDate.parse(console.nextLine(), DateTimeFormatter.ofPattern("dd-MM-yyyy"));
  9.  
  10.         String result = input.plusDays(999).format(DateTimeFormatter.ofPattern("dd-MM-yyyy"));
  11.         System.out.println(result);
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment