js计算357整除的数
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
//1-10000 之间能同时被3、5、7 整除的数,输出到页面上,每6个换行
window.onload = function(){
var j = 0;
for(var i = 1; i <=10000; i++){
if(i % 3 == 0 && i % 5 == 0 && i % 7 == 0){
document.write(i + '、');
j++;
if(j == 6){
document.write('<br>');
j = 0;
}
}
}
}
</script>
</head>
<body>
</body>
</html>
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634843.html