Advertisement
r1s7o

Thousand Days on Earth

Mar 6th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.time.LocalDate;
  2. import java.time.format.DateTimeFormatter;
  3. import java.util.Scanner;
  4.  
  5. public class Thousand_Days_on_Earth {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner console = new Scanner(System.in);
  10.  
  11.         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
  12.  
  13.         LocalDate date = LocalDate.parse(console.nextLine(), formatter);
  14.  
  15.         String birth = date.format(formatter);
  16.  
  17.         LocalDate birthDate = LocalDate.parse(birth, formatter);
  18.  
  19.         LocalDate after1000Days = birthDate.plusDays(999);
  20.  
  21.         System.out.println(after1000Days.format(formatter));
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement