bool is_run(int X)//四年一闰,百年不闰,四百年再闰 { return (x % 400 == 0 )|| (x % 4 == 0 && x % 100 != 0); } int moths1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};//非闰年 365 int moths2[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};//闰年 366
哥,is_run好像写错了,应该是: return x % 400 == 0 || x % 4 == 0 && x % 100 != 0;
哥,is_run好像写错了,应该是: return x % 400 == 0 || x % 4 == 0 && x % 100 != 0;