不二如是 发表于 2017-4-5 18:34:32

已有 5 人购买  本主题需向作者支付 5 鱼币 才能浏览 购买主题

shishunfu 发表于 2017-6-11 14:37:35

取余运算
a>b时,a÷b=c……d
a/b=c,a%b=d

a=b, a÷a=1.....0
a/a=1,a%a=0

a<b,a/b=0.xxx....a
a%b=a

wyb407 发表于 2019-10-25 10:08:55

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>for-loop</title>
</head>
<body>

<p>点击下面的按钮,利用循环弹出之间所有整数</p>
<button onclick="myFunction()">button</button>
<p id="demo"></p>
<script>
    function myFunction(){
      var x=0,i=0;
      for(;i<=33;)
      {
            x=x + i +"&nbsp";
            i++;
      }
      
      document.getElementById("demo").innerHTML=x;
    }
</script>

</body>
</html>
页: [1]
查看完整版本: 0 0 2 0 ★ for循环语句大全 + %(取余)详解 | 【鱼C庆典版】