Calculation of the Number of Days Between Two Dates


Submit solution

Points: 20
Time limit: 0.0s
Memory limit: 64M

Author:
Problem type

題目說明

<1122檢定考題>
提示使用者從鍵盤輸入兩個日期,
日期格式為 yyyymmdd,其合法日期範圍為 1970101~ 20240115;
然後從螢幕輸出這兩個日期相差天數。

提示1:需考量使用者輸入的日期可能先大後小,或先小後大 提示2:yyyy為西元年、mm為月份、dd為日期。如19990101為1999年1月1號、20000229 為2000年2月29號

輸入

兩個日期,日期格式為 yyyymmdd

輸出

天數

sample input & output

輸入 輸出
樣本1 20110221  20110625 124
樣本2 20230721  20190310 1594
樣本3 20001231  19990101 730

Comments

There are no comments at the moment.