1 / 10
文档名称:

阴阳转换代码.doc

格式:doc   大小:43KB   页数:10页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

阴阳转换代码.doc

上传人:wz_198613 2019/3/12 文件大小:43 KB

下载得到文件列表

阴阳转换代码.doc

相关文档

文档介绍

文档介绍:prototype:  int calconv( struct convdate * );   struct convdate  {    int source;       ==0 则输入日期为西历, !=0 则输入为农历    int solaryear;    输出或输入之西历年份    int solarmonth;   西历月    int solardate;    西历日    int lunaryear;    输出或输入之农历年份    int lunarmonth;   农历月    int lunardate;    农历日    int weekday;      该日为星期几 ( 0==星期日, 1==星期一, ... )    int kan;          该日天干     ( 0==甲, 1==乙, ..., 9==癸 )    int chih;         该日地支     ( 0==子, 1==丑, ..., 11==亥 )  };   呼叫时须设定 souce 的值, 若为 0 则为西历转农历, 否则为农历转西历. 然後视  输入为西历或农历来设定西历或农历的年月日. 转换後的年月日会填入结构中( 农  历或西历 ), 以及该日为星期几, 天干地支.  若函式的返回值为 0 表示没有错误, 1 为输入之年份错误, 2 为输入之月份错误,  3 为输入之日期错误.  输入之西历年须在 1937 - 2031 间  输入之农历年须在 1936 - 2030 间  若须扩充, 则增加 lunarcal[] */ #define firstyear 1936  /* the first year in lunarcal[] */struct convdate {  int source;  int solaryear;  int solarmonth;  int solardate;  int lunaryear;  int lunarmonth;  int lunardate;  int weekday;  int kan;  int chih; };  struct taglunarcal {  int basedays;         /* 到西历 1 月 1 日到农历正月初一的累积日数 */  int intercalation;    /* 闰月月份. 0==此年没有闰月 */  int baseweekday;      /* 此年西历 1 月 1 日为星期几再减 1 */  int basekanchih;      /* 此年西历 1 月 1 日之干支序号减 1 */  int monthdays[13];    /* 此农历年每月之大小, 0==小月(29日), 1==大月(30日) */ };  struct taglunarcal lunarcal[] = {  { 23,  3, 2, 17, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0 },  /* 1936 */  { 41,  0, 4, 23, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1 },  { 30,  7, 5, 28, 1, 1, 0, 0, 1, 0,