<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 功能強大 支持多語言、二開方便! 廣告
                # C 程序:檢查閏年 > 原文: [https://www.programiz.com/c-programming/examples/leap-year](https://www.programiz.com/c-programming/examples/leap-year) #### 在此示例中,您將學習檢查用戶輸入的年份是否為閏年。 要理解此示例,您應該了解以下 [C 編程](/c-programming "C tutorial")主題: * [C 編程運算符](/c-programming/c-operators) * [C `if...else`語句](/c-programming/c-if-else-statement) * * * 除世紀年份(以 00 結尾的年份)外,閏年可精確地除以 4。 只有將世紀完全除以 400,世紀年才是閏年。 例如, * 1999 年不是閏年 * 2000 年是閏年 * 2004 年是閏年 * * * ## 檢查閏年的程序 ```c #include <stdio.h> int main() { int year; printf("Enter a year: "); scanf("%d", &year); // leap year if perfectly visible by 400 if (year % 400 == 0) { printf("%d is a leap year.", year); } // not a leap year if visible by 100 // but not divisible by 400 else if (year % 100 == 0) { printf("%d is not a leap year.", year); } // leap year if not divisible by 100 // but divisible by 4 else if (year % 4 == 0) { printf("%d is a leap year.", year); } // all other years are not leap year else { printf("%d is not a leap year.", year); } return 0; } ``` **輸出 1** ```c Enter a year: 1900 1900 is not a leap year. ``` **輸出 2** ```c Enter a year: 2012 2012 is a leap year. ```
                  <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>

                              哎呀哎呀视频在线观看