判断闰年

var year = parseInt(prompt("请输入年份"));

if((year%4==0 && year%100!=0) || year%400==0){

  console.log("闰年");

}

else{

  console.log("非闰年");

}

posted @ 2016-01-14 10:33  Barbie7  阅读(149)  评论(0编辑  收藏  举报