30 years before and after

Report a typo

Write a program that reads a date from the standard input and prints two dates: 30 years before and after compared to the given date.

Sample Input 1:

2017-06-03

Sample Output 1:

1987-06-03
2047-06-03

Sample Input 2:

2017-04-28

Sample Output 2:

1987-04-28
2047-04-28
Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___

Create a free account to access the full topic