<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var sum=0;
for (var i=0;i<=100;i++){
if(i%2==0){
sum+=i
}
}
alert(sum)
console.log(sum)
</script>
</body>
</html>
JS: 求1~~100之间的偶数之和
最新推荐文章于 2023-05-02 22:12:36 发布