PROGRAMMING:The first n days
Input the value of month, year and day (all integer numbers), and input an integer number n with a value range of [- 10,10]. Output the first n days of the date (when n > 0) and the last n days of the date (when n < 0).
The year value range is [18202020], the month value range is [1,12], and the date value range is [1,31].
**Note: any date related class or method in Java is not allowed**
###Input format:
Enter the value of month, year, day and the value of N in one line, which can be separated by one or more spaces or carriage returns.
###Output format:
1. When the value of year, month, day and N is illegal, output "wrong format";
1. When the input data is legal, output "n days ago is: Year Month Day"
###Input sample 1:
Here is a set of inputs. For example:
```in
2018 6 19 8
```
###Output sample 1:
The corresponding output is given here. For example:
```out
8 days ago is:2018-6-11
```
###Input sample 2:
Here is a set of inputs. For example:
```in
2018 6 19 -8
```
###Output sample 2:
The corresponding output is given here. For example:
```out
-8 days ago is:2018-6-27
```
answer:If there is no answer, please comment
1. Note that n is negative (refer to assignment 7-4)
1. Consider how to simplify and understand the operation code as much as possible on the basis of assignment 4
The year value range is [18202020], the month value range is [1,12], and the date value range is [1,31].
**Note: any date related class or method in Java is not allowed**
###Input format:
Enter the value of month, year, day and the value of N in one line, which can be separated by one or more spaces or carriage returns.
###Output format:
1. When the value of year, month, day and N is illegal, output "wrong format";
1. When the input data is legal, output "n days ago is: Year Month Day"
###Input sample 1:
Here is a set of inputs. For example:
```in
2018 6 19 8
```
###Output sample 1:
The corresponding output is given here. For example:
```out
8 days ago is:2018-6-11
```
###Input sample 2:
Here is a set of inputs. For example:
```in
2018 6 19 -8
```
###Output sample 2:
The corresponding output is given here. For example:
```out
-8 days ago is:2018-6-27
```
answer:If there is no answer, please comment
1. Note that n is negative (refer to assignment 7-4)
1. Consider how to simplify and understand the operation code as much as possible on the basis of assignment 4