1、救命的C++编程题
#include
#include
{
sin>>年>>月>>日;
for(inti=1);i<月++i)
sum+=smonth(i);
sum+=day;
begin=first(year);
cout<<"今年是"<
return0;
}
intsmonth(intm)
{
change(m)
case7:
Case8:
Case10:
Case12:Return31;
Case4:
Case6:<br/>Case9:
Case11:Return30;
case2:if((((year%4==0&year%100!=0)||year%400==0))
return29;
无
return28;
默认值:return0;
}
}
startDate(int)
{
double;
s=floor(year-1+(year-1)/4.0-(year-1)/100.0+(year-1)/400.0+1);
return(int)s%7;
}
快速格式有点乱,请自行修改。