#include # include #include #include #include using namespace std;void bangzhu();void xianzaishijian();void chakanrili();int runnian(int);int tianshu(int,int);void shuru();int shurupanduan(int ,int,int);void shuchu();void shuxiang(int);void shuchushuxiang();void dijitian();void nianli();int main() //主函数{ int a; bangzhu(); while(cin>>a) {if(a==0) break; switch(a) {//case 0: break;break; case 1: xianzaishijian();break; case 2: chakanrili();break; case 3: shuchushuxiang();break; case 4: dijitian();break; case 5: nianli();break; case 9: bangzhu();break;} }return 0;}void xianzaishijian() //输出现在时间以及当前月份日历{ time_t t = time(NULL); struct tm *local = localtime(&t); int year = local -> tm_year + 1900; int month = local -> tm_mon + 1; int day = local -> tm_mday;int hour = local -> tm_hour; int minute = local -> tm_min; int second = local -> tm_sec; int d,y,m,l;y=year;m=month;d=day;int z=1;l=shurupanduan(y, m,z); while(l==0) {cin>>y>>m;l=shurupanduan(y,m,z);} int q,s,i,sum=0; for(i=1905;i 2) sum++;switch(m){case 1:q=31;break;case 2:q=28;break;case 3:q=31;break;case 5:q=31;break;case 7:q=31;break;case 8:q=31;break;case 10:q=31;break;case 12:q=31;break;case 4:q=30;break;case 6:q=30;break;case 9:q=30;break;case 11:q=30;break;}s=runnian(y);if(s==1&&m==2)q++;int u,w;u=sum%7;w=3*u;sum=sum+d;d--;d=sum%7;cout <<"当前时间: "< < <<"年"< <<"月"< <<"日"<<' '<<"星期"; switch(d){case 0:cout<<"日";break;case 1:cout<<"一";break;case 2:cout<<"二";break;case 3:cout<<"三";break;case 4:cout<<"四";break;case 5:cout<<"五";break;case 6:cout<<"六";break;}cout<<" ";shuxiang(year);cout < <<" "< <<":"< <<":"< < < 12||c<0){l=0;cout<<"您的输入有误请重新输入"< q){l=0;cout<<"您的输入有误请重新输入"< >y>>m;int z=1;l=shurupanduan(y,m,z); while(l==0) {cin>>y>>m;l=shurupanduan(y,m,z);} int q,s,i,sum=0; for(i=1905;i 2) sum++;switch(m){case 1:q=31;break;case 2:q=28;break;case 3:q=31;break;case 5:q=31;break;case 7:q=31;break;case 8:q=31;break;case 10:q=31;break;case 12:q=31;break;case 4:q=30;break;case 6:q=30;break;case 9:q=30;break;case 11:q=30;break;}s=runnian(y);if(s==1&&m==2)q++;int u,w;u=sum%7;w=3*u;cout<<" 日 一 二 三 四 五 六"< <=w;i++)cout<<' '; for(i=1;i<=q;i++) {if(u==6) {cout< < < <<" "< >y; shuxiang(y); cout< >y>>m>>d;l=shurupanduan(y,m,d); while(l==0) {cin>>y>>m;l=shurupanduan(y,m,d);} for(i=1;i 2) sum++; sum=sum+d; cout< <<"年"< <<"月"< <<"日是这一年中第"< <<"天"< >s; ofstream outfile(s,ios::out);cout<<"请输入年份"< >y;for(m=1;m<=12;m++){int z=1;l=shurupanduan(y,m,z); while(l==0) {cin>>y>>m;l=shurupanduan(y,m,z);} int q,s,i,sum=0; for(i=1905;i 2) sum++;switch(m){case 1:q=31;break;case 2:q=28;break;case 3:q=31;break;case 5:q=31;break;case 7:q=31;break;case 8:q=31;break;case 10:q=31;break;case 12:q=31;break;case 4:q=30;break;case 6:q=30;break;case 9:q=30;break;case 11:q=30;break;}s=runnian(y);if(s==1&&m==2)q++;int u,w;u=sum%7;w=3*u;outfile<<" "< <<"年"< <<"月"< <<" 日 一 二 三 四 五 六"< <=w;i++)outfile<<' '; for(i=1;i<=q;i++) {if(u==6) {outfile< < < <<" "< >y>>m;l=shurupanduan(y,m,z);} int q,s,i,sum=0; for(i=1905;i 2) sum++;switch(m){case 1:q=31;break;case 2:q=28;break;case 3:q=31;break;case 5:q=31;break;case 7:q=31;break;case 8:q=31;break;case 10:q=31;break;case 12:q=31;break;case 4:q=30;break;case 6:q=30;break;case 9:q=30;break;case 11:q=30;break;}s=runnian(y);if(s==1&&m==2)q++;int u,w;u=sum%7;w=3*u;cout<<" "< <<"年"< <<"月"< <<" 日 一 二 三 四 五 六"< <=w;i++)cout<<' '; for(i=1;i<=q;i++) {if(u==6) {cout< < < <<" "<