#include <string.h>
#include <stdio.h>
#include <Windows.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; };
typedef struct
{
char yue; /*阴历月份,闰月用负数表示*/
char days; /*该月的天数*/
} Yue;
struct Year
{
long day1; /*上个年度除夕对应的"总天数"*/
Yue yue[13]; /*13是为了对付可能发生的闰月*/
};
struct Year a[2101-1800];
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;
}
date getSolar(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);
}
int main()
{
return 0;
}