判断1000到2000年之间有多少闰年

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        for(var i=1000;i<=2000;i++){
            if(i%4===0 && i%100!==0 || i%400===0){
                document.write(i+"是闰年")
            }
        }
    </script>
</body>
</html>
posted @ 2020-10-27 18:34  无敌臭弟弟  阅读(199)  评论(0编辑  收藏  举报