.
.
# include
#include
#include
#include
#include
# define YEAR 365
int numday[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}};
int leap(int year);
int calday(int y,int m);
int counterdays(int year,int month,int day);
int week(int year,int month,int day);
int eachyeartotal(int year,int month,int day);
int maxDay(int y,int month);
void print(int y,int m,int w);
void festival (int year,int month,int day);
int IsLeap(int y);
int guanli(int i);
void rili(int year,int month);
int rili1();
void rili2();
void rili3();
void rili4();
void rili5();
void fan();
void show(int year,int month,int date,int sec,int mini,int hour);
int main()
{
int i;
printf("***************************************\n");
printf("1.查询日历,输入年份:\n");
printf("2.查询该月日历及对应星期,输入年份和月份:\n");
printf("3.查询星期几及节日,输入年月日:\n");
printf("4.距您输入日期还有多少天,输入日期:\n");
printf("5.通过键盘上下控制不同年月日:\n");
scanf("%d",&i);
guanli(i);
return 0;
}
int guanli(int i)
{
switch(i)
{
case 1:rili1();return main();
case 2:rili2();return main();
case 3:rili3();return main();
case 4:rili4();return main();
case 5:rili5();return main();
}
return 0;
}
int rili1()
{
int year;
int n,i;
printf("输入年份:");
scanf("%d",&year);
printf("the calendar of the year%d\n",year);
printf("\n");
printf("=============================\n");
for(i=1;i<13;i++)
{
printf(" %d月份\n",i);
rili(year,i);
}
n = leap(year);
return 0;
}
void rili2()
{
int year,month,w;
printf("输入年月:");
scanf("%d%d",&year,&month);
w=calday(year,month);
print(year,month,w);
}
void rili3()
{
int year,month,day,number;
printf("输入年月日:");
scanf("%d%d%d",&year,&month,&day);
festival(year,month,day);
number=week(year,month,day);
printf("星期%d",number);
}
void rili4()
{
int year,month,day;
printf("输入年月日:");
scanf("%d%d%d",&year,&month,&day);
eachyear