var i = 1000;
var count = 0;
while(i <= 2000) {
  if (i % 2 == 0 && i % 100 !=0 || i % 400 == 0) {
      document.write(i, "&nbsp");
      count++;
      if(count % 4 == 0) {
        document.write("<br/>");
      }   
  }
  i++;
}

相关文章: