输入一个年份,判断闰年还是平年 var year=prompt("请输入一个年份"); year=Number(year); if(year%4===0 && year%100!==0 || year%400===0){ document.write(year+"是闰年"); }else{ document.write(year+"是平年"); }