<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Kotlin 程序:顯示數字因數 > 原文: [https://www.programiz.com/kotlin-programming/examples/factors-number](https://www.programiz.com/kotlin-programming/examples/factors-number) #### 在此程序中,您將學習在 Kotlin 中使用`for`循環顯示給定數字的所有因數。 ## 示例:正整數的因數 ```kt fun main(args: Array<String>) { val number = 60 print("Factors of $number are: ") for (i in 1..number) { if (number % i == 0) { print("$i ") } } } ``` 運行該程序時,輸出為: ```kt Factors of 60 are: 1 2 3 4 5 6 10 12 15 20 30 60 ``` 在上述程序中,要查找其因素的編號存儲在變量`num`中(60)。 `for`循環從 1 迭代到`num`。 在每次迭代中,檢查`num`是否可被`i`完全整除(`i`是`num`的因數)和`i`的值增加 1。 以下是等效的 Java 代碼:[顯示數字因數的 Java 程序](/java-programming/examples/factors-number "Java Program to Display Factors of a Number")
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看