• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            road420

            導航

            <2006年5月>
            30123456
            78910111213
            14151617181920
            21222324252627
            28293031123
            45678910

            統計

            常用鏈接

            留言簿(2)

            隨筆檔案

            文章檔案

            搜索

            最新評論

            閱讀排行榜

            評論排行榜

            萬年歷

            ?

            // 已知1980年1月1日是星期二!
            #include < iostream.h >
            #include
            < process.h >
            #include
            < string .h >

            struct ?Date
            {
            ?
            int ?year;
            ?
            int ?month;
            ?
            int ?date;
            ?
            int ?day;
            ?
            char ?week[ 10 ];
            }
            ;

            char ? * dweek[ 7 ] = { " Sun " , " Mon " , " Tues " , " Weds " , " Thur " , " Fri " , " Sat " } ;
            Date?showday(Date?pd)
            {
            ?
            int ?i = 0 ,j = 0 ,k = 0 ,time,score;
            ?i
            = (pd.year - 1980 ) * 365 + (pd.year - 1980 ) / 4 - (pd.year - 1980 ) / 100 + (pd.year - 1980 ) / 400 ;
            ?i
            = i % 7 + 1 ;
            ?k
            = (pd.date - 1 ) % 7 ;?
            ?
            if ((pd.year % 100 != 0 ) && (pd.year % 4 == 0 ) || (pd.year % 400 == 0 ))
            ????
            {
            ?????
            int ?dday1[ 12 ] = { 31 , 29 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ;
            ?????
            if (pd.month == 2 )???
            ???
            {
            ????????pd.day
            = 29 ;
            ?????
            if (pd.date > pd.day)
            ?????????exit(
            0 );
            ???????cout
            << " 該月的天數為: " << pd.day << endl;???
            ?????}

            ?????
            else
            ?????
            {
            ????pd.day
            = dday1[pd.month - 1 ];
            ????
            if (pd.date > dday1[pd.month - 1 ])
            ?????exit(
            0 );
            ????cout
            << " 該月的天數為: " << pd.day << endl;
            ???}

            ????
            for (time = 0 ;time < pd.month - 1 ;time ++ )
            ?????j
            += dday1[time];
            ??j
            = j % 7 ;???
            ??score
            = i + j + k + 2 ;
            ??
            if (score < 7 )
            ????strcpy(pd.week,dweek[score]);?
            ??
            else
            ??
            {
            ???
            while (score >= 7 )
            ???
            {
            ????score
            -= 7 ;
            ???}

            ??strcpy(pd.week,dweek[score]);?
            ??}
            ????
            ??cout
            << " 該天的星期數為: " << pd.week << endl;???
            ??}
            ?
            ????
            else
            ????
            {
            ????
            int ????dday2[ 12 ] = { 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ;
            ??
            if (pd.month == 2 )???
            ???
            {
            ????????pd.day
            = 28 ;
            ?????
            if (pd.date > pd.day)
            ?????????exit(
            0 );
            ???????cout
            << " 該月的天數為: " << pd.day << endl;???
            ?????}

            ?????
            else
            ?????
            {
            ????pd.day
            = dday2[pd.month - 1 ];
            ????
            if (pd.date > dday2[pd.month - 1 ])
            ?????exit(
            0 );
            ????cout
            << " 該月的天數為: " << pd.day << endl;
            ???}

            ????
            for (time = 0 ;time < pd.month - 1 ;time ++ )
            ?????j
            += dday2[time];
            ??j
            = j % 7 ;???
            ??score
            = i + j + k + 2 ;
            ??
            if (score < 7 )
            ????strcpy(pd.week,dweek[score]);?
            ??
            else
            ??
            {
            ???
            while (score >= 7 )
            ???
            {
            ????score
            -= 7 ;
            ???}

            ??strcpy(pd.week,dweek[score]);?
            ??}
            ????
            ??cout
            << " 該天的星期數為: " << pd.week << endl;
            ??}

            return ?pd;
            }


            void ?main()
            {
            ????Date?obymd;
            ????obymd.year
            = 1980 ;
            ????obymd.month
            = 1 ;
            ????obymd.date
            = 1 ;
            ????strcpy(obymd.week,dweek[
            2 ]);
            ????cout
            << " 請輸入年,月,日: " << " ? " ;
            ????cin
            >> obymd.year >> obymd.month >> obymd.date;
            ????showday(obymd);
            }

            posted on 2006-05-09 22:03 深邃者 閱讀(241) 評論(0)  編輯 收藏 引用

            日韩人妻无码一区二区三区久久 | 久久99精品久久久久久久不卡| 91精品国产91久久| 国产精品天天影视久久综合网| 久久香蕉国产线看观看精品yw| 久久久久高潮综合影院| 2021国产精品久久精品| 欧美亚洲另类久久综合婷婷| 精品久久久久久无码中文字幕| 久久综合中文字幕| 久久精品国产影库免费看| 99久久精品毛片免费播放| 国产国产成人精品久久| 青青青伊人色综合久久| 久久精品国产一区二区三区| 欧美激情精品久久久久久久| 一本久久免费视频| 无码日韩人妻精品久久蜜桃| 久久99国产亚洲高清观看首页 | 狠狠色丁香婷婷综合久久来 | 亚洲精品国产字幕久久不卡| 青青草原精品99久久精品66| 色综合久久最新中文字幕| 精品一久久香蕉国产线看播放| 久久精品国产亚洲7777| 精品久久人人爽天天玩人人妻| 久久国产热精品波多野结衣AV| 国产成人久久777777| 一本色综合久久| 丰满少妇人妻久久久久久| 狠狠色综合网站久久久久久久| 一级做a爰片久久毛片免费陪| 伊人色综合久久天天人手人婷| 国产精品久久自在自线观看| 久久精品中文字幕第23页| 漂亮人妻被黑人久久精品| 久久精品成人免费国产片小草| 无码日韩人妻精品久久蜜桃| 日本亚洲色大成网站WWW久久 | 亚洲精品tv久久久久久久久久| 久久久av波多野一区二区|