//C语言实现简单的日历 ,输入年份,就会输出整年的日历
#include <stdio.h>
#include <conio.h>
#include <windows.h>
long int f(int year, int month)
{/*f(年,月)=年-1,如月<3;否则,f(年,月)=年*/
if (month<3) return year - 1;
else return year;
}
long int g(int month)
{/*g(月)=月+13,如月<3;否则,g(月)=月+1*/
if (month<3) return month + 13;
else return month + 1;
}
long int n(int year, int month, int day)
{
/*N=1461*f(年、月)/4+153*g(月)/5+日*/
return 1461L * f(year, month) / 4 + 153L * g(month) / 5 + day;
}
int w(int year, int month, int day)
{
/*w=(N-621049)%7(0<=w<7)*/
return(int)((n(year, month, day) % 7 - 621049L % 7 + 7) % 7);
}
int date[12][6][7];
int day_tbl[][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 } };
mai