Advertisement
desislava_topuzakova

1000days

Jan 13th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.time.format.*;
  3. import java.time.LocalDate;
  4.  
  5. public class Problem13_After1000Days {
  6.  
  7. public static void main(String[] agrs) {
  8. Scanner scanner = new Scanner(System.in);
  9.  
  10. DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
  11.  
  12. String text = scanner.nextLine();
  13. LocalDate parsedDate = LocalDate.parse(text, formatter);
  14. LocalDate after1000 = parsedDate.plusDays(999);
  15. System.out.printf("%1$td-%1$tm-%1$tY", after1000);
  16.  
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement