usingnamespacestd;___(1)___Month(Jan,F(xiàn)eb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);classDate{public:Date(intyear,Monthm_month){___(2)___=year;if(m_monthDec)month=Jan;elsemonth=m..."/>

中文字幕综合一区,伊人av网,欧美中日韩在线,亚洲国产香蕉视频,黄视频在线免费,天天操天天爱天天爽,狠狠躁天天躁

軟題庫(kù) 移動(dòng)APP 掃碼下載APP 隨時(shí)隨地移動(dòng)學(xué)習(xí) 培訓(xùn)課程
試卷名稱 2005年上半年程序員考試下午真題試題(案例分析)
考試中心《2005年上半年程序員考試下午真題試題(案例分析)》在線考試
試卷年份2005年上半年
試題題型【分析簡(jiǎn)答題】
試題內(nèi)容

【說(shuō)明】
下面程序的功能是計(jì)算并輸出某年某月的天數(shù)。
【C++程序】
#include < iostream>
using namespace std;
___(1)___ Month ( Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec ) ;
class Date {
public:
Date ( int year , Month m_month ) {
___(2)___ = year ;
if ( m_month < Jan || m_month > Dec ) month = Jan;
else month = m_month;
} ;
~Date () {} ;
bool IsLeapYear () {
return ( ( year % 4 = = 0&&year % 100 != 0 ) || year %400 = = 0);
};
int CaculateDays () {
switch ( ___(3)___ ) {
case Feb : {
if ( ___(4)___ ) return 29;
else return 28;
}
case Jan : case Mar : case May : case Jul : case Aug : case : Oct:
case Dec : return 31;
case Apr : case Jun : case Sep : case Nov : return 30;
}
};
private :
int year;
Month month;
};
Void main () {
Date day ( 2000 ,F(xiàn)eb );
Cout << day. ___(5)___ ();
}


相關(guān)試題

推薦文章