Create a function f(date) that counts the number of days from 1900-01-01 to date. How can we calculate the answer ?
提示 2
The answer is just |f(date1) - f(date2)|.
提示 3
How to construct f(date) ?
提示 4
For each year from 1900 to year - 1 sum up 365 or 366 in case of leap years. Then sum up for each month the number of days, consider the case when the current year is leap, finally sum up the days.