Is the date between the two other dates?

Report a typo

Write a program that checks if the date X is located between dates M and N on the timeline and that these dates are not equal. Your program should read three dates from the standard input. Each date should have a year-month-day format.

Input data format

The single line containing three dates (X, M, N) separated by the space character.

Output data format

The program must output "true" or "false".

Sample Input 1:

2017-10-13 2017-10-11 2017-10-15

Sample Output 1:

true

Sample Input 2:

2017-05-06 2017-12-31 2017-01-01

Sample Output 2:

true

Sample Input 3:

2017-04-04 2017-05-05 2017-06-06

Sample Output 3:

false
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