全文预览

浙江大学ACM模板

上传者:你的雨天 |  格式:pdf  |  页数:142 |  大小:12009KB

文档介绍
month)\rreturn a.month-b.month;\rreturn a.day-b.day;\r)\r=>34?4@\rint weekday(date a){\rint tm=a.month>=3?(a.month-2):(a.month+10);\rint ty=a.month>=3?a.year:(a.year-l);\rreturn (ty+ty/4-ty/l00+ty/400+(int)(2.6*tm-0.2)+a.day)%7;\r)\r34ABCD\rint date2int(date a){\rint ret=a.year*365+(a.year-1 )/4-(a.year-1 )/100+(a.year-1 )/400,i\rdays[ 1 ]+=leap(a.year);\rfor (i=0;i<a.month-l;ret+=days[i++]);\rdays[l]=28;\rreturn ret+a.day;\r)\rBCDA34\rdate int2date(int a){\rdate ret;\rret.year=a/146097*400;\rfor (a%=l 46097 ;a>=365+leap(ret.year);a-=365+leap(ret.year),ret.year++);\rdays[ 1 ]+=leap(ret.year);\rfor (ret.month= 1 ;a>=days [ret. month-1 J;a-=days[ret.month-1 J,ret.month++);.\rdays[l]=28;\rrel.day=a+1;\rreturn ret;\r)

收藏

分享

举报
下载此文档