1~100内偶数相加,但不包括66和88

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
            
            let sum = 0         
            for(let i=1;i<=100;i++){                
                if(i % 2 == 0){
                    if(i==66 || i==88){continue}
                sum += i
                }    
            }
            
            console.log(sum)
            
            
        </script>
    </body>
</html>
posted @ 2022-10-20 17:58  墨圆  阅读(86)  评论(0)    收藏  举报