C++的源代码

时间:2015-04-09 07:45:46
【文件属性】:

文件名称:C++的源代码

文件大小:2KB

文件格式:TXT

更新时间:2015-04-09 07:45:46

输入日期显示星期几

输入日期后,可显示所输入的日期是星期几 int main() { int x=0,y=0,z=0,year,month,day,D; cout<<"please input your date(year month day):"; cin>>year>>month>>day; x=getcenturyvalue(year); y=getmonthvalue(month,year); z=getyearvalue(year); D=(day+x+y+z)%7; if(D==0) cout<<"the date is Sunday!"; else if(D==1) cout<<"the date is Monday!"; else if(D==2) cout<<"the date is Tuseday!"; else if(D==3) cout<<"the date is Wendesday!"; else if(D==4) cout<<"the date is Thursday!"; else if(D==5) cout<<"the date is Friday!"; else if(D==6) cout<<"the date is Saturday!"; return 0; }


网友评论