修复闰年判断错误的问题
This commit is contained in:
parent
2a6c52c460
commit
9dd4e96f20
@ -3,9 +3,9 @@
|
||||
int month2day(int year,int month){
|
||||
int tmp[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
|
||||
|
||||
if (year % 4 == 0)tmp[1]++;
|
||||
if(((year%4==0) && (year%100!=0)) || year%400==0)tmp[1]++;
|
||||
|
||||
return tmp[month-1];
|
||||
return tmp[month-2];
|
||||
}
|
||||
|
||||
int main(){
|
||||
|
Loading…
Reference in New Issue
Block a user