代码:
<!DOCTYPE html
>
<html>
<head>
<meta charset
="utf-8">
<title>100内奇数之和
</title
>
</head
>
<body>
<script>
var num
= 0;
for(var i
= 0; i
< 101 ;i
++){
if(i
% 2 != 0){
num
+= i
;
}
}
document
.write(num
);
</script
>
</body
>
</html
>
运行结果:
转载请注明原文地址: https://lol.8miu.com/read-22153.html