资源描述:
《万年历阴阳历转化》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#includeusingnamespacestd;intSum,A[12],b[12],M,D,w[2];intY1[]={101,214,308,312,315,401,501,504,512,601,701,801,910,1001,1006,1024,1225,0};charstr1[][18]={"元旦","情人节","妇女节","植树节","消费者权益日","愚人节","劳动节","青年节","护士节","儿童节","建党节","建军节","教师节","国庆节","老人节","联
2、合国日","圣诞节"};intY2[]={101,115,505,707,815,909,1208,1224,1230,0};charstr2[][18]={"*农历春节","元宵节","端午节","七夕情人节","*中秋节","重阳节","腊八节","小年","*除夕"};charjie[][9]={"小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"};ints
3、tr[]={0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758};intjudge(intyear)//判断是否是闰年{if((year%4==0&&year%100!=0)
4、
5、year%400==0)return(1);elsereturn(0);}voidDate(intw[]){i
6、nti,j,y,n;doubles;y=w[0];n=w[1];s=31556925974.7*(y-1900)/60000+str[n]+5*1440+125;for(i=1900;i=0;i++){s-=b[i]*1440;}s+=b[i-1]*1440;w[0]=i;for(j=0;s>=0;j++){s-=1440;}w[1]=j;}voidmain(){voidyinli();intyear,month,day,y,i,j,z,a[100],s,N;b[0
7、]=31;b[2]=31;b[3]=30;b[4]=31;b[5]=30;b[6]=31;b[7]=31;b[8]=30;b[9]=31;b[10]=30;b[11]=31;SYSTEMTIMEsys;intYEAR,MONTH,DAY;sys.wYear=2012;sys.wMonth=06;sys.wDay=01;cout<<"请输入日期:";cin>>YEAR>>MONTH>>DAY;sys.wYear=YEAR;sys.wMonth=MONTH;sys.wDay=DAY;cout<<"Thecurrenttimeis:"<<'';yea
8、r=sys.wYear;month=sys.wMonth;day=sys.wDay;cout<9、j]=w[0]*100+w[1];j++;}if((month==w[0])&&(day==w[1])){if(N==1)cout<<".";cout<10、break;default:Sum=1+b[10]+day;}}else{for(i=0;i