久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='pGmH7'></small><noframes id='pGmH7'>

<legend id='pGmH7'><style id='pGmH7'><dir id='pGmH7'><q id='pGmH7'></q></dir></style></legend><tfoot id='pGmH7'></tfoot>

        <bdo id='pGmH7'></bdo><ul id='pGmH7'></ul>
      1. <i id='pGmH7'><tr id='pGmH7'><dt id='pGmH7'><q id='pGmH7'><span id='pGmH7'><b id='pGmH7'><form id='pGmH7'><ins id='pGmH7'></ins><ul id='pGmH7'></ul><sub id='pGmH7'></sub></form><legend id='pGmH7'></legend><bdo id='pGmH7'><pre id='pGmH7'><center id='pGmH7'></center></pre></bdo></b><th id='pGmH7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pGmH7'><tfoot id='pGmH7'></tfoot><dl id='pGmH7'><fieldset id='pGmH7'></fieldset></dl></div>

        如何確定給定日期是否是該月的第 N 個工作日?

        How do I determine if a given date is the Nth weekday of the month?(如何確定給定日期是否是該月的第 N 個工作日?)
        <i id='4P9rQ'><tr id='4P9rQ'><dt id='4P9rQ'><q id='4P9rQ'><span id='4P9rQ'><b id='4P9rQ'><form id='4P9rQ'><ins id='4P9rQ'></ins><ul id='4P9rQ'></ul><sub id='4P9rQ'></sub></form><legend id='4P9rQ'></legend><bdo id='4P9rQ'><pre id='4P9rQ'><center id='4P9rQ'></center></pre></bdo></b><th id='4P9rQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4P9rQ'><tfoot id='4P9rQ'></tfoot><dl id='4P9rQ'><fieldset id='4P9rQ'></fieldset></dl></div>

          <tbody id='4P9rQ'></tbody>

          • <bdo id='4P9rQ'></bdo><ul id='4P9rQ'></ul>
            <legend id='4P9rQ'><style id='4P9rQ'><dir id='4P9rQ'><q id='4P9rQ'></q></dir></style></legend>
          • <tfoot id='4P9rQ'></tfoot>

            <small id='4P9rQ'></small><noframes id='4P9rQ'>

                  本文介紹了如何確定給定日期是否是該月的第 N 個工作日?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這是我想要做的:給定日期、星期幾和整數(shù)n,判斷日期是否是該月的第n天.

                  Here is what I am trying to do: Given a date, a day of the week, and an integer n, determine whether the date is the nth day of the month.

                  例如:

                  • 1/1/2009,Monday,2 的輸入將是錯誤的,因為 1/1/2009 不是第二個星期一

                  • input of 1/1/2009,Monday,2 would be false because 1/1/2009 is not the second Monday

                  輸入2008 年 11 月 13 日,星期四,2將返回 true,因為這是第二個星期四

                  input of 11/13/2008,Thursday,2 would return true because it is the second Thursday

                  如何改進這個實現(xiàn)?

                  private bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n)
                  {
                      int d = date.Day;
                      return date.DayOfWeek == dow && (d/ 7 == n || (d/ 7 == (n - 1) && d % 7 > 0));
                  }
                  

                  推薦答案

                  你可以改變一周的檢查,這樣函數(shù)就會變成:

                  You could change the check of the week so the function would read:

                  private bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n){
                    int d = date.Day;
                    return date.DayOfWeek == dow && (d-1)/7 == (n-1);
                  }
                  

                  除此之外,它看起來還不錯且高效.

                  Other than that, it looks pretty good and efficient.

                  這篇關(guān)于如何確定給定日期是否是該月的第 N 個工作日?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

                            <bdo id='BBPR8'></bdo><ul id='BBPR8'></ul>

                            <small id='BBPR8'></small><noframes id='BBPR8'>

                          • <legend id='BBPR8'><style id='BBPR8'><dir id='BBPR8'><q id='BBPR8'></q></dir></style></legend>
                              <tbody id='BBPR8'></tbody>
                            <tfoot id='BBPR8'></tfoot>
                            <i id='BBPR8'><tr id='BBPR8'><dt id='BBPR8'><q id='BBPR8'><span id='BBPR8'><b id='BBPR8'><form id='BBPR8'><ins id='BBPR8'></ins><ul id='BBPR8'></ul><sub id='BBPR8'></sub></form><legend id='BBPR8'></legend><bdo id='BBPR8'><pre id='BBPR8'><center id='BBPR8'></center></pre></bdo></b><th id='BBPR8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BBPR8'><tfoot id='BBPR8'></tfoot><dl id='BBPR8'><fieldset id='BBPR8'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 99精品欧美| 欧美精品久久久 | 爱草在线 | 欧美日韩成人在线 | 91传媒在线观看 | 亚州影院 | 九色在线观看 | 欧美日韩不卡在线 | 亚洲成人激情在线观看 | 久草成人| 国产成人在线观看免费 | 久久午夜视频 | 欧美 日韩 中文 | 久久精品性视频 | 国产高清在线精品一区二区三区 | 夜操| 97精品超碰一区二区三区 | 韩日一区二区三区 | 亚洲欧美视频 | 午夜电影在线播放 | 亚洲综合在线视频 | 中文字幕av色 | 国产精品美女久久久久aⅴ国产馆 | 午夜网 | wwwsihu| 欧美在线观看一区二区 | 国产成人免费视频网站视频社区 | 久久99精品久久久久久青青日本 | 黄色一级特级片 | 亚洲精品国产电影 | 国产精品成人一区二区三区 | 亚洲网在线| 亚洲三级av | 亚洲色图综合 | 99亚洲综合 | 亚洲一区视频在线 | 国产精品一区二区不卡 | 欧美aaa一级片 | 久久99精品久久久 | 成人免费视频网站在线观看 | 国产精品美女一区二区 |