#include #include #include #include // 每月天数 int month_day(int year,int month) { switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: return 31;break; case 4: case 6: case 9: case 11: return 30;break; case 2: if((year%4==0)&&(year%100!=0)||(year%400==0)) { return 29; break; } else { return 28; break; } } } // 年历 void year_calendar(int year) { int month,days,weekday,sum_day; int i,j; year; printf("请输入要查询的年份:"); scanf("%d",&year); for(i=1;itm_year; now_month=1+p->tm_mon; now_day=p->tm_mday; printf("当前日期是:%d/%d/%d\n",now_year,now_month,now_day); //输入日期的总天数 int i,k,sum_day; printf("请输入要查询的年/月/日:"); scanf("%d/%d/%d",&year,&month,&day); for(i=1;isum_nowday) printf("\n输入日期与当前日期相差%d天",sum_day-sum_nowday); else printf("\n输入日期与当前日期相差%d天",sum_nowday-sum_day); } //日期查询 void rq(int year,int month,int day) { printf("请输入要查询的年/月/日:"); int sum_day,i,k,weekday; scanf("%d/%d/%d",&year,&month,&day); for(i=1;i