/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
公历日期与农历日期的相互转换程序
【极限范围】1800-1-25~2101-1-28
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#include<stdio.h>
#include<string.h>
#define leap(y) (y%4==0&&y%100||y%400==0)
char days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char *xq[]={"日","一","二","三","四","五","六",
"七","八","九","十","冬","腊" };
struct date{ int year,month,day; }
d1={ 1800,1,25 },/*阴历1800正月初一*/
d2={ 2101,1,28 };/*阴历2100腊月廿九*/
typedef struct
{ char yue; /*阴历月份,闰月用负数表示*/
char days; /*该月的天数*/
} Yue;
struct Year
{ long day1; /*上个年度除夕对应的"总天数"*/
Yue yue[13]; /*13是为了对付可能发生的闰月*/
};
void disp(struct date lunar)/*用天干地支显示农历日期*/
{ int nian=lunar.year,yue=lunar.month,ri=lunar.day;
static char tg[]="甲乙丙丁戊己庚辛壬癸";
static char dz[]="子丑寅卯辰巳午未申酉戌亥";
static char sx[]="鼠牛虎兔龙蛇马羊猴鸡狗猪";
int ix=(6+nian)%10*2;
int iy=(8+nian)%12*2;
printf("农历%c%c%c%c年(%c%c年) ",tg[ix],
tg[ix+1],dz[iy],dz[iy+1],sx[iy],sx[iy+1]);
if(yue<0){yue*=-1;printf("闰");}
if(yue>1)printf("%s月",xq[yue]);
else printf("正月");
if(ri<11){ printf("初"); }
else if(ri<20){ printf("十");ri-=10; }
else if(ri<21){ printf("二十");ri=0; }
else if(ri<30){ printf("廿");ri-=20; }
else { printf("三十");ri=0; }
if(ri) printf("%s",xq[ri]);
}
int Num(char *han)
{ char*p; int i;
static char a[]="正二三四五六七八九十冬腊";
for(i=0;i<24;i+=2)
if(a[i]==han[0]&&a[i+1]==han[1])break;
if(i==24)return 0;
else return i/2+1;
}
long total(struct date a)
{ int c,m,y=a.year-1;
days[2]=28+leap(a.year);
for(c=a.day,m=1;m<a.month;m++)c+=days[m];
return c+y/4-y/100+y/400+y*365L;
}
struct date getdate(long total)
{ struct date a={1,1,1};
long t=total-1;int i;
a.year+=i=t/365.2425;
t-=i/4-i/100+i/400+i*365L;
days[2]=28+leap(a.year);
if(t>=days[2]+337)
{ t-=days[2]+337;a.year++; }
while(t>=days[a.month])
t-=days[a.month++];
a.day+=t;return a;
}
struct Year a[2101-1800];
void initial()
{ char s[256],*p;
int i,m,run,y=0;
long tot=total(d1)-1,t;
FILE*fp=fopen("18002100.101","r");
while(1){
a[y].day1=tot;
fgets(s,255,fp);
if(feof(fp))break;
if(s[0]!=' ')continue;
p=strstr(s,"闰");
for(m=0;m<12+!!p;m++)
{ int days;
sscanf(s+m*2+4,"%d,",&days);
tot+=a[y].yue[m].days=29+days;
a[y].yue[m].yue=1+m;
}
if(p){
run=Num(p+2);
a[y].yue[run].yue=-run;
for(m=run+1;m<13;m++)
a[y].yue[m].yue--; }
y++;
} fclose(fp);
}
int ok(struct date d)
{ int y=d.year,m=d.month,t=d.day,ok=1;
if(y<1800||y>2100)ok=-1;
else if(m<1||m>12)ok=0;
else{days[2]=28+leap(y);
if(t<1||t>days[m])ok=0;}
if(total(d)<total(d1))ok=-1;
return ok;
}
int Day(int Year,int Month)
{ int y=Year-1800,m=Month,i;
for(i=0;i<13;i++)
if(m==a[y].yue[i].yue)
return a[y].yue[i].days;
return 0;
}
int OK(struct date D)
{ int Y=D.year,M=D.month,T=D.day;
if(Y<1800||Y>2100)return -1;
if(T<=0||T>30)return 0;
if(M==0||M>12)return 0;
if(T>Day(Y,M))return 0;
return 1;
}
struct date getLunar(struct date d)/* 阳历→阴历 */
{ int m,y=0;long t=total(d);
while(t>a[y].day1)y++;
t-=a[--y].day1;
for(m=0;t>a[y].yue[m].days;m++)
t-=a[y].yue[m].days;
d.year=y+1800;d.month=a[y].yue[m].yue;d.day=t;
return(d);
}
struct date getSolar(struct date D)/* 阴历→阳历 */
{ long t;int i;
t=a[D.year-1800].day1+D.day;
for(i=0; ;i++){
if(a[D.year-1800].yue[i].yue==D.month)break;
t+=a[D.year-1800].yue[i].days; }
return getdate(t);
}
void main()
{ int cho,Y;initial();
Menu:
do{ clrscr();
gotoxy(10, 7);printf("1.将公历转换为农历");
gotoxy(10,10);printf("2.将农历转换为公历");
gotoxy(10,13);printf("3.叁百年农历闰月表");
gotoxy(10,16);printf("4.农历某年大月小月");
gotoxy(10,19);printf("0.运行结束返回系统");
gotoxy(10,25);printf("选择: ");cho=getch();
} while(cho<'0'||cho>'4');
if(cho=='4'){ gotoxy(10,25);printf("年份? ");
scanf("%d",&Y);if(Y<1800||Y>2100)Y=2006; }
clrscr();if(cho<='2')printf("\n\n\n\n");
if(cho=='1')
while(1)
{ char c; struct date DT,dt; int o;
do{ printf("公元(yyyy-mm-dd): ");
scanf("%d-%d-%d",&dt.year,&dt.month,&dt.day);
o=ok(dt);if(o==-1)goto Menu; }while(o<=0);
DT=getLunar(dt);disp(DT);
printf("〔星期%s〕\n\n",xq[total(dt)%7]);
}
else if(cho=='2')
while(1)
{ char c; struct date DT,dt; int o;
do{ printf("农历(YYYY.MM.DD): ");
scanf("%d.%d.%d",&DT.year,&DT.month,&DT.day);
o=OK(DT);if(o==-1)goto Menu; }while(o<=0);
dt=getSolar(DT);
printf("公元%d年%d月%d日〔星期%s〕\n\n",
dt.year,dt.month,dt.day,xq[total(dt)%7]);
}
else if(cho=='3')
{ int counter=0,r,i;
gotoxy(19,1);printf("1800—2100年间农历闰月列表\n");
for(i=0;i<=2100-1800;i++)
for(r=0;r<13;r++)
if(a[i].yue[r].yue<0){
if(counter++%5==0)printf("\n ");
printf("%d闰%s月%s ",1800+i,xq[r],
a[i].yue[r].days>29?"大":"小"); }
getch();goto Menu;
}
else if(cho=='4')
{ int counter=0,i,d,m;
printf("\n\n\n 农历%d年大月小月列表\n\n\n ",Y);
for(i=0;i<13;i++)
{ d=a[Y-1800].yue[i].days;
m=a[Y-1800].yue[i].yue;
if(d)
if(m<0)printf("闰%s月%s ",-m>1?xq[-m]:"正",d>29?"大":"小");
else printf("%s月%s ",+m>1?xq[+m]:"正",d>29?"大":"小");
if(++counter%4==0)printf("\n\n ");
} getch();goto Menu;
}
else if(cho=='0')clrscr();
}
/***************************************
* 农历1800-2100年大月小月与闰月 *
* (连同111个闰月在内共3723个月) *
* 公元1800-01-01为腊月(大)初七 *
* 公元1800-01-25为农历正月初一 *
***************************************/
1,0,1,1,0,1,0,1,0,1,0,1,0, //1800闰四月小
0,1,1,0,1,0,1,1,0,1,0,1,
0,0,1,0,1,0,1,1,1,0,1,0,
1,0,0,1,0,1,0,1,1,0,1,1,0, //1803闰二月小
1,0,0,1,0,0,1,1,0,1,1,1,
0,1,0,1,0,0,0,1,0,1,1,1,0, //1805闰六月小
1,1,0,1,0,0,0,1,0,1,1,0,
1,1,1,0,0,1,0,0,1,0,1,1,
0,1,1,0,1,0,1,0,1,0,0,1,0, //1808闰五月小
1,1,0,1,1,0,1,0,1,0,0,1,
0,1,0,1,1,0,1,1,0,1,0,1,
0,0,1,0,1,0,1,1,0,1,1,0,1, //1811闰三月小
0,0,1,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,0,1,0,1,1,1,0,
1,1,0,1,0,0,0,1,0,1,1,0,1, //1814闰二月小
1,1,0,0,1,0,0,1,0,1,0,1,
1,1,0,1,0,1,0,0,1,0,1,0,1, //1816闰六月小
1,0,1,1,0,1,0,1,0,0,1,0,
1,0,1,1,0,1,1,0,1,0,0,1,
0,1,0,1,0,1,1,0,1,1,0,1,0, //1819闰四月小
0,1,0,1,0,1,0,1,1,1,0,1,
0,0,1,0,0,1,0,1,1,1,0,1,
1,0,1,0,0,0,1,0,1,1,0,1,1, //1822闰三月小
1,0,1,0,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,1,0,1,1, //1824闰七月大
1,0,1,0,1,0,0,1,0,1,0,1,
1,0,1,1,0,1,0,0,1,0,1,0,
1,0,1,1,0,1,0,1,0,1,0,1,0, //1827闰五月大
1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,1,
0,0,1,0,0,1,0,1,1,0,1,1,1, //1830闰四月小
0,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,1,0,1,1,1, //1832闰九月小
0,1,0,1,0,0,1,0,1,0,1,1,
0,1,1,0,1,0,0,1,0,1,0,1,
0,1,1,0,1,1,0,0,1,0,1,0,1, //1835闰六月小
0,1,0,1,1,0,1,0,1,0,1,0,
1,0,1,0,1,0,1,1,0,1,0,1,
0,1,0,1,0,0,1,1,0,1,1,0,1, //1838闰四月小
0,1,0,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,1,0,1,0,1, //1841闰三月大
1,1,0,1,0,0,1,0,1,0,1,0,
1,1,1,0,1,0,0,1,0,1,0,1,0, //1843闰七月大
1,1,0,1,0,1,0,1,0,1,0,1,
0,1,0,1,1,0,1,0,1,0,1,0,
1,0,1,0,1,0,1,0,1,1,0,1,0, //1846闰五月小
1,0,0,1,0,1,0,1,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,1,0,1,0,1,0,1,1, //1849闰四月小
1,0,1,0,0,1,0,0,1,1,0,1,
1,1,0,1,0,0,1,1,0,1,0,1,0, //1851闰八月小
1,0,1,1,0,0,1,0,1,0,0,1,
1,0,1,1,0,1,0,1,0,1,0,1,
0,1,0,1,0,1,1,0,1,0,1,0,1, //1854闰七月小
0,0,1,0,1,1,0,1,1,0,1,0,
1,0,0,1,0,1,0,1,1,1,0,1,
0,1,0,0,1,0,1,0,1,0,1,1,1, //1857闰五月小
0,1,0,0,1,0,0,1,1,0,1,1,
1,0,1,0,0,1,0,0,1,0,1,1,
1,0,1,1,0,0,1,0,0,1,0,1,1, //1860闰三月大
0,1,1,0,1,0,1,0,1,0,0,1,
1,0,1,0,1,1,0,1,0,1,0,0,1, //1862闰八月小
0,1,1,0,1,0,1,1,0,1,0,1,
0,0,1,0,1,0,1,1,0,1,1,0,
1,0,0,1,0,1,0,1,1,0,1,1,0, //1865闰五月大
1,0,0,1,0,0,1,1,0,1,1,1,
0,1,0,0,1,0,0,1,0,1,1,1,
0,1,1,0,0,1,0,0,1,0,1,1,0, //1868闰四月小,以下"原为"取自<人生必备万年历>
1,1,1,0,0,1,0,0,1,0,1,0,
1,1,1,0,1,0,1,0,0,1,0,1,0, //1870闰十月小,原为1,1,1,0,1,0,1,0,0,1,0,1,1,
1,1,0,1,1,0,1,0,1,0,0,1, // 原为0,1,0,1,1,0,1,0,1,0,0,1,
0,1,0,1,1,0,1,0,1,1,0,1,
0,0,1,0,1,0,1,1,0,1,1,0,1, //1873闰六月大,原为0,0,1,0,1,1,1,0,0,1,1,0,1,
0,0,1,0,1,0,1,0,1,1,1,0,
1,0,0,1,0,0,1,0,1,1,1,0,
1,1,0,0,1,0,0,1,0,1,1,0,1, //1876闰五月小
1,1,0,0,1,0,0,1,0,1,0,1, // 原为1,1,0,0,1,0,1,0,0,1,0,1,
1,1,0,1,0,1,0,0,1,0,1,0,
1,1,0,1,1,0,1,0,0,1,0,1,0, //1879闰三月大,原为1,1,1,1,0,0,1,0,0,1,0,1,0,
1,0,1,1,0,1,1,0,1,0,0,1,
0,1,0,1,0,1,1,0,1,1,0,1,0, //1881闰七月小
0,1,0,1,0,1,0,1,1,0,1,1,
0,0,1,0,0,1,0,1,1,1,0,1,
1,0,0,1,0,0,1,0,1,1,0,1,1, //1884闰五月小,原为1,0,0,1,1,0,0,0,1,1,0,1,1,
1,0,0,1,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,1,0,1,
1,1,0,1,0,1,0,0,1,0,1,0,1, //1887闰四月小
1,0,1,1,0,1,0,0,1,0,1,0,
1,0,1,1,0,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,0,1, //1890闰二月小,原为0,1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,1,
0,0,1,0,0,1,0,1,1,0,1,1,1, //1892闰六月小
0,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,1,0,1,0, //1895闰五月小
1,1,1,0,1,0,0,1,0,1,0,1, // 原为1,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,0,1,0,1,0,1,0,
1,0,1,0,1,1,0,1,0,1,0,1,0, //1898闰三月小
1,0,1,0,1,0,1,1,0,1,0,1,
0,1,0,0,1,0,1,1,0,1,1,0,1, //1900闰八月小
0,1,0,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,0,1,1,0,1, //1903闰五月小
1,1,0,1,0,0,1,0,0,1,1,0,
1,1,0,1,1,0,0,1,0,1,0,1,
0,1,1,0,1,0,1,0,1,0,1,0,1, //1906闰四月大
0,1,0,1,0,1,1,0,1,0,1,0,
1,0,0,1,1,0,1,0,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,1,0,1, //1909闰二月小
0,1,0,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,1,0,0,1,1,0,1,1, //1911闰六月小
1,0,1,0,0,1,0,0,1,1,0,1,
1,1,0,1,0,0,1,0,0,1,0,1,
1,1,0,1,0,1,0,1,0,0,1,0,1, //1914闰五月大
1,0,1,1,0,1,0,1,0,1,0,0,
1,1,0,1,0,1,1,0,1,0,1,0,
1,0,0,1,0,1,1,0,1,1,0,1,0, //1917闰二月小
1,0,0,1,0,1,0,1,1,0,1,1,
0,1,0,0,1,0,0,1,1,0,1,1,1, //1919闰七月大
0,1,0,0,1,0,0,1,0,1,1,1,
1,0,1,0,0,1,0,0,1,0,1,1,
1,0,1,1,0,0,1,0,0,1,0,1,1, //1922闰五月小
0,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,1,0,1,0,1,0,0,
1,0,1,0,1,1,0,1,1,0,1,0,1, //1925闰四月大
0,0,1,0,1,0,1,1,0,1,1,0,
1,0,0,1,0,1,0,1,0,1,1,1,
0,1,0,0,1,0,0,1,0,1,1,1,1, //1928闰二月小
0,1,0,0,1,0,0,1,0,1,1,1,
0,1,1,0,0,1,0,0,1,0,1,1,0, //1930闰六月小
1,1,0,1,0,1,0,0,1,0,1,0,
1,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,1,0,1,0,1,0,0,1, //1933闰五月大
0,1,0,1,1,0,1,0,1,1,0,1,
0,0,1,0,1,0,1,1,0,1,1,0,
1,0,0,1,0,0,1,1,0,1,1,1,0, //1936闰三月大
1,0,0,1,0,0,1,0,1,1,1,0,
1,1,0,0,1,0,0,1,0,1,1,0,1, //1938闰七月大
1,1,0,0,1,0,0,1,0,1,0,1,
1,1,0,1,0,1,0,0,1,0,1,0,
1,1,0,1,1,0,1,0,0,1,0,1,0, //1941闰六月大
1,0,1,1,0,1,0,1,0,1,0,1,
0,1,0,1,0,1,1,0,1,0,1,0,
1,0,1,0,1,0,1,0,1,1,0,1,1, //1944闰四月大
0,0,1,0,0,1,0,1,1,1,0,1,
1,0,0,1,0,0,1,0,1,1,0,1,
1,1,0,0,1,0,0,1,0,1,0,1,1, //1947闰二月小
1,0,1,0,1,0,0,1,0,1,0,1,
1,0,1,1,0,1,0,0,1,0,1,0,1, //1949闰七月小
0,1,1,0,1,1,0,0,1,0,1,0,
1,0,1,1,0,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,0,1, //1952闰五月大
0,1,0,0,1,1,0,1,1,0,1,0,
1,0,1,0,0,1,0,1,1,0,1,1,
0,1,0,1,0,0,1,0,1,0,1,1,1, //1955闰三月大
0,1,0,1,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,1,0,1,0, //1957闰八月小
1,1,1,0,1,0,0,1,0,1,0,1,
0,1,1,0,1,0,1,0,1,0,1,0,
1,0,1,0,1,1,0,1,0,1,0,1,0, //1960闰六月小
1,0,1,0,1,0,1,1,0,1,0,1,
0,1,0,0,1,0,1,1,0,1,1,0,
1,0,1,0,0,1,0,1,0,1,1,1,0, //1963闰四月小
1,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,0,1,1,0,
1,1,1,0,1,0,0,1,0,0,1,1,0, //1966闰三月小
1,1,0,1,1,0,0,1,0,1,0,1,
0,1,0,1,1,0,1,0,1,0,1,0,1, //1968闰七月小
0,1,0,1,0,1,1,0,1,0,1,0,
1,0,0,1,0,1,1,0,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,1,0,1, //1971闰五月小
0,1,0,0,1,0,1,0,1,1,0,1,
1,0,1,0,0,1,0,0,1,1,0,1,
1,1,0,1,0,0,1,0,0,1,1,0,1, //1974闰四月小
1,1,0,1,0,0,1,0,0,1,0,1,
1,1,0,1,0,1,0,1,0,0,1,0,1, //1976闰八月小
1,0,1,1,0,1,0,1,0,1,0,0,
1,0,1,1,0,1,1,0,1,0,1,0,
1,0,0,1,0,1,1,0,1,1,0,1,0, //1979闰六月大
1,0,0,1,0,1,0,1,1,0,1,1,
0,1,0,0,1,0,0,1,1,0,1,1,
1,0,1,0,0,1,0,0,1,0,1,1,1, //1982闰四月小
1,0,1,0,0,1,0,0,1,0,1,1,
1,0,1,1,0,0,1,0,0,1,0,1,1, //1984闰十月小
0,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,1,0,1,0,1,0,0,
1,0,1,0,1,1,0,1,1,0,1,0,0, //1987闰六月小
1,0,1,0,1,0,1,1,0,1,1,0,
1,0,0,1,0,1,0,1,0,1,1,1,
0,1,0,0,1,0,0,1,0,1,1,1,1, //1990闰五月小
0,1,0,0,1,0,0,1,0,1,1,1,
0,1,1,0,0,1,0,0,1,0,1,1,
0,1,1,0,1,0,1,0,0,1,0,1,0, //1993闰三月小
1,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,0,1,1,0,0,1,0,1, //1995闰八月小
0,1,0,1,1,0,1,0,1,1,0,0,
1,0,1,0,1,0,1,1,0,1,1,0,
1,0,0,1,0,0,1,1,0,1,1,0,1, //1998闰五月小
1,0,0,1,0,0,1,0,1,1,1,0,
1,1,0,0,1,0,0,1,0,1,1,0,
1,1,0,1,0,1,0,0,1,0,1,0,1, //2001闰四月小
1,1,0,1,0,1,0,0,1,0,1,0,
1,1,0,1,1,0,1,0,0,1,0,1,
0,1,0,1,1,0,1,0,1,0,1,0,1, //2004闰二月小
0,1,0,1,0,1,1,0,1,0,1,0,
1,0,1,0,1,0,1,0,1,1,0,1,1, //2006闰七月小
0,0,1,0,0,1,0,1,1,1,0,1,
1,0,0,1,0,0,1,0,1,1,0,1,
1,1,0,0,1,0,0,1,0,1,0,1,1, //2009闰五月小
1,0,1,0,1,0,0,1,0,1,0,1,
1,0,1,1,0,1,0,0,1,0,1,0,
1,0,1,1,0,1,0,1,0,1,0,1,0, //2012闰四月小
1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,0,1, //2014闰九月小
0,1,0,0,1,0,1,1,1,0,1,0,
1,0,1,0,0,1,0,1,1,0,1,1,
0,1,0,1,0,0,1,0,1,0,1,1,1, //2017闰六月大
0,1,0,1,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,0,1,1,
0,1,1,1,0,1,0,0,1,0,1,0,1, //2020闰四月小
0,1,1,0,1,0,1,0,1,0,1,0,
1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,0,1,1,0,1,1,0,1,0,1, //2023闰二月小
0,1,0,0,1,0,1,1,0,1,1,0,
1,0,1,0,0,1,0,1,0,1,1,1,0, //2025闰六月小
1,0,1,0,0,1,0,0,1,1,1,0,
1,1,0,1,0,0,1,0,0,1,1,0,
1,1,1,0,1,0,0,1,0,0,1,1,0, //2028闰五月小
1,1,0,1,0,1,0,1,0,0,1,1,
0,1,0,1,1,0,1,0,1,0,1,0,
0,1,1,0,1,0,1,1,0,1,0,1,0, //2031闰三月小
1,0,0,1,0,1,1,0,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,1,0,1, //2033闰冬月小
0,1,0,0,1,0,1,0,1,1,0,1,
1,0,1,0,0,1,0,0,1,1,0,1,
1,1,0,1,0,0,1,0,0,1,0,1,1, //2036闰六月大
1,1,0,1,0,0,1,0,0,1,0,1,
1,1,0,1,0,1,0,1,0,0,1,0, // 原为1,1,0,1,0,1,0,1,0,1,0,0,
1,1,0,1,1,0,1,0,1,0,1,0,0, //2039闰五月小
1,0,1,1,0,1,0,1,1,0,1,0,
0,1,0,1,0,1,1,0,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,0,1,1, //2042闰二月小
0,1,0,0,1,0,0,1,1,0,1,1,
1,0,1,0,0,1,0,0,1,0,1,1,1, //2044闰七月小
1,0,1,0,0,1,0,0,1,0,1,1,
1,0,1,0,1,0,1,0,0,1,0,1,
1,0,1,1,0,1,0,1,0,0,1,0,1, //2047闰五月大
0,1,1,0,1,1,0,1,0,0,1,0,
1,0,1,0,1,1,0,1,1,0,1,0,
0,1,0,1,0,1,0,1,1,0,1,1,0, //2050闰三月大
1,0,0,1,0,0,1,1,0,1,1,1,
0,1,0,0,1,0,0,1,0,1,1,1,1, //2052闰八月小
0,1,0,0,1,0,0,1,0,1,1,1,
0,1,1,0,0,1,0,0,1,0,1,1,
0,1,1,0,1,0,1,0,0,1,0,1,0, //2055闰六月大
1,1,1,0,1,0,1,0,0,1,0,1,
0,1,1,0,1,0,1,0,1,0,1,0, // 原为0,1,1,0,1,0,1,1,0,0,1,0,
1,0,1,0,1,0,1,1,0,1,1,0,0, //2058闰四月大
1,0,1,0,1,0,1,0,1,1,1,0,
1,0,0,1,0,0,1,0,1,1,1,0,
1,1,0,0,1,0,0,1,0,1,1,1,0, //农历2061年闰三月小
1,1,0,0,1,0,0,1,0,1,1,0,
1,1,0,1,0,1,0,0,1,0,1,0,1, //农历2063年闰七月小
1,1,0,1,0,1,0,0,1,0,1,0,
1,1,0,1,1,0,1,0,0,1,0,1,
0,1,0,1,1,0,1,0,1,0,1,0,1, //农历2066年闰五月小
0,1,0,1,0,1,1,0,1,0,1,0,
1,0,1,0,0,1,1,0,1,1,0,1,
0,1,0,1,0,0,1,0,1,1,1,0,1, //农历2069年闰四月小
0,1,0,1,0,0,1,0,1,1,0,1,
1,0,1,0,1,0,0,1,0,1,0,1,1, //农历2071年闰八月小
1,0,1,0,1,0,0,1,0,1,0,1,
1,0,1,1,0,1,0,0,1,0,1,0,
1,0,1,1,0,1,0,1,0,1,0,1,0, //农历2074年闰六月小
1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,1,0,1,0,1,1,0,1,0,
1,0,1,0,0,1,0,1,1,1,0,1,0, //农历2077年闰四月小
1,0,1,0,0,1,0,1,1,0,1,1,
0,1,0,1,0,0,1,0,1,0,1,1,
1,0,1,0,1,0,0,1,0,0,1,1,1, //农历2080年闰三月小
0,1,1,0,1,0,0,1,0,0,1,1,
0,1,1,1,0,0,1,0,1,0,0,1,1, //农历2082年闰七月小
0,1,1,0,1,0,1,0,1,0,1,0,
1,0,1,0,1,1,0,1,0,1,0,1,
0,1,0,0,1,1,0,1,1,0,1,0,1, //农历2085年闰五月大
0,1,0,0,1,0,1,1,0,1,1,0,
1,0,1,0,0,1,0,1,0,1,1,1,
0,1,0,1,0,0,1,0,0,1,1,1,0, //农历2088年闰四月小
1,1,0,1,0,0,0,1,0,1,1,0,
1,1,1,0,1,0,0,1,0,0,1,1,0, //农历2090年闰八月小
1,1,0,1,0,1,0,1,0,0,1,0,
1,1,0,1,1,0,1,0,1,0,1,0,
0,1,1,0,1,0,1,1,0,1,0,1,0, //农历2093年闰六月大
0,1,0,1,0,1,1,0,1,1,0,1,
0,1,0,0,1,0,1,0,1,1,1,0,
1,0,1,0,0,1,0,0,1,1,1,0,1, //农历2096年闰四月小
1,0,1,0,0,0,1,0,1,1,0,1,
1,1,0,1,0,0,0,1,0,1,0,1,
1,1,0,1,1,0,0,1,0,0,1,0,1, //农历2099年闰二月小
1,1,0,1,0,1,0,1,0,0,1,0, //设农历2100年腊月小