<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 功能強大 支持多語言、二開方便! 廣告
                # 控制結構:if-else if-else是我們熟知的一種控制結構。Lua 跟其他語言一樣,提供了if-else的控制結構。因為是大家熟悉的語法,本節只簡單介紹一下它的使用方法。 #### 單個 if 分支 型 ~~~ x = 10 if x > 0 then print("x is a positive number") end ~~~ > 運行輸出:x is a positive number #### 兩個分支: if-else 型 ~~~ x = 10 if x > 0 then print("x is a positive number") else print("x is a non-positive number") end ~~~ > 運行輸出:x is a positive number #### 多個分支: if-elseif-else型 ~~~ score = 90 if score == 100 then print("Very good!Your score is 100") elseif score >= 60 then print("Congratulations, you have passed it,your score greater or equal to 60") --此處可以添加多個elseif else print("Sorry, you do not pass the exam! ") end ~~~ > 運行輸出:Congratulations, you have passed it,your score greater or equal to 60 與C語言的不同之處是elseif是連在一起的,若不else與if寫成"else if"則相當于在else 里嵌套,如下代碼: ~~~ score = 0 if score == 100 then print("Very good!Your score is 100") elseif score >= 60 then print("Congratulations, you have passed it,your score greater or equal to 60") else if score > 0 then print("Your score is better than 0") else print("My God, your score turned out to be 0") end --與上一示例代碼不同的是,此處要添加一個end end ~~~ > 運行輸出:My God, your score turned out to be 0
                  <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>

                              哎呀哎呀视频在线观看