if(year<0){return -1;}if((year%4==0&&year%100!=0)||(year%400==0)){return 1;}else{return 0;}}
来源: http://www.bubuko.com/infodetail-2568042.html