万年历算法及源码万年历算法一、阳历算法具体算法见函数Void get_solar_day_date(void),这样阳历日历的星期排法就确定了。表1:月份123456789101112闰年312931303130313130313031非闰年312831303130313130313031变量定义:Public:Unsigned int temp_total_day;Unsigned char gc_solar_calendar_year;Unsigned char gc_solar_calendar_month;Unsigned char gc_solar_calendar_date;Unsigned char gc_lunar_calendar_year;Unsigned char gc_lunar_calendar_month;Unsigned char gc_lunar_calendar_date;Unsigned char start_day_of_week;说明:函数get_solar_day_date(void)的输入变量:gc_solar_calendar_year和gc_solar_calendar_month输出变量:start_day_of_week和temp_total_dayVoid get_solar_day_date(void){unsigned char temp01;/*------calculate what dayis the dayof the current month and year.Mon~Sun?---*//*条件初始化二次,减少运算数据量.temp_total_day是int型变量*/