1118 Number of Days in a Month
Given a year year
and a month month
, return the number of days of that month.
Example 1:
Example 2:
Example 3:
Constraints:
1583 <= year <= 2100
1 <= month <= 12
一开始还以为很简单,后来百度一下才知道闰年的规则这么复杂。小学时候被骗了。其实是,一般的年,能被4整除,不被100整除就是闰年。如果是百年的话,要被400整除才是闰年。
Last updated