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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                第二種形式的條件執行是選擇執行,選擇執行中存在有兩種可能,由條件表達式來決定哪種可能被執行。語法看起來像這樣: ~~~ if( x%2 == 0) { cout << "x is even" << endl; }else{ cout << "x is odd" << endl; } ~~~ 如果x除以2得到的余數是0,則我們知道X是偶數,代碼會輸出一條信息表明此意。由于條件非真即假,因而有且僅有一條語句會被執行。 說句題外話,如果你認為你經常需要檢驗數字的奇偶性(偶數性或奇數性),你可能想把這段代碼“包裝”到一個函數里: ~~~ void printParity (int x) { if (x%2 == 0) { cout << "x is even" << endl; } else { cout << "x is odd" << endl; } ~~~ } 現在你有了一個名為printParity的函數,它會為任何你愿意提供的整數輸出合適的信息。在main方法中,你可以這樣調用它: ~~~ printParity (17); ~~~ 要永遠記住當你調用一個函數時,不需要聲明你提供的參數的類型。C++可以知道它們是什么類型。你應該抵制誘惑,別把代碼寫成這樣: ~~~ int number = 17; printParity (int 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>

                              哎呀哎呀视频在线观看