<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Kotlin 程序:計算整數位數 > 原文: [https://www.programiz.com/kotlin-programming/examples/digits-count](https://www.programiz.com/kotlin-programming/examples/digits-count) #### 在此程序中,您將學習在 Kotlin 中使用`while`循環來計算位數。 ## 示例 1:計算整數中的位數 ```kt fun main(args: Array<String>) { var count = 0 var num = 1234567 while (num != 0) { num /= 10 ++count } println("Number of digits: $count") } ``` 運行該程序時,輸出為: ```kt Number of digits: 7 ``` 在此程序中,將循環`while`循環,直到測試表達式`num != 0`的值為 0(假)。 * 第一次迭代后,`num`將除以 10,其值將為 345。然后,`count`增至 1。 * 在第二次迭代后,`n` um 的值將為 34,并且`count`遞增為 2。 * 在第三次迭代后,`num`的值將為 3,并且`count`增至 3。 * 第四次迭代后,`num`的值將為 0,并且`count`增至 4。 * 然后將測試表達式求值為`false`并終止循環。 以下是等效的 Java 代碼: [Java 程序:對整數中的位數進行計數](/java-programming/examples/digits-count "Java Program to Count Number of Digits in an Integer")
                  <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>

                              哎呀哎呀视频在线观看