<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ```scala object App{ def main(args: Array[String]): Unit = { var num:Int = 0 // while循環 while(num < 100) { println(num) num = num + 1; } // do/while循環 do { println(num) num = num + 5 } while (num < 200) // for/to循環 val count = 100 for (i:Int <- 1 to count) { println(i) // 輸出1~100 } // for/until循環 for (i:Int <- 1 until 100) { println(i) // 輸出1~99 } // 中斷,相當于java中的break關鍵字 import scala.util.control.Breaks._ val num2 = 100 for (i:Int <- 1 to num2 by 2) { // by 2 步長為2 if (i > 5) break // break是一個函數 break(),當沒有參數時可以省略 () } // for循環過濾 val num3 = 10 for(i:Int <- 1 to num3; if i%2==0; if i>5 ) { // 過濾語句相當于i%2==0 && i>5 println(i) } 或者 for (i:Int <- 1 to num3 if i%2==0; if i> 5) { println(i) } // for/yield,返回元素集合 val num4 = 10 var retList = for (i:Int <- 1 to num4; if i%2==0; if i>5) yield i for(v <- retList) println(v) // 輸出6 8 10 // for雙層循環 for(i:Int <- 1 to 10; j:Int <- 1 to 5) { println(i * j) } } } ```
                  <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>

                              哎呀哎呀视频在线观看