国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

陰陽歷算法(轉(zhuǎn))

2019-11-18 15:27:16
字體:
供稿:網(wǎng)友

程序?yàn)椋?nbsp;
/*

西歷農(nóng)歷轉(zhuǎn)換程式 黃曉鳴 1995,7,25

PRototype: int calconv( strUCt convdate * );

struct convdate
{
    int source; ==0 則輸入日期為西歷, !=0 則輸入為農(nóng)歷
    int solaryear; 輸出或輸入之西歷年份
    int solarmonth; 西歷月
    int solardate; 西歷日
    int lunaryear; 輸出或輸入之農(nóng)歷年份
    int lunarmonth; 農(nóng)歷月
    int lunardate; 農(nóng)歷日
    int weekday; 該日為星期幾 ( 0==星期日, 1==星期一, ... )
    int kan; 該日天干 ( 0==甲, 1==乙, ..., 9==癸 )
    int chih; 該日地支 ( 0==子, 1==丑, ..., 11==亥 )
};

呼叫時(shí)須設(shè)定 souce 的值, 若為 0 則為西歷轉(zhuǎn)農(nóng)歷, 否則為農(nóng)歷轉(zhuǎn)西歷. 然後視
輸入為西歷或農(nóng)歷來設(shè)定西歷或農(nóng)歷的年月日. 轉(zhuǎn)換後的年月日會(huì)填入結(jié)構(gòu)中( 農(nóng)
歷或西歷 ), 以及該日為星期幾, 天干地支.
若函式的返回值為 0 表示沒有錯(cuò)誤, 1 為輸入之年份錯(cuò)誤, 2 為輸入之月份錯(cuò)誤,
3 為輸入之日期錯(cuò)誤.
輸入之西歷年須在 1937 - 2031 間
輸入之農(nóng)歷年須在 1936 - 2030 間
若須擴(kuò)充, 則增加 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 日到農(nóng)歷正月初一的累積日數(shù) */
    int intercalation; /* 閏月月份. 0==此年沒有閏月 */
    int baseweekday; /* 此年西歷 1 月 1 日為星期幾再減 1 */
    int basekanchih; /* 此年西歷 1 月 1 日之干支序號(hào)減 1 */
    int monthdays[13]; /* 此農(nóng)歷年每月之大小, 0==小月(29日), 1==大月(30日)*/
};

struct taglunarcal lunarcal[] = {
, /* 1936 */
,
,
,
, /* 1940 */
,
,
,
, /* 1944 */

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 延长县| 海宁市| 化德县| 林州市| 东兰县| 普格县| 乐昌市| 晋中市| 即墨市| 丽江市| 商水县| 花莲市| 开封县| 无为县| 澄城县| 乌兰浩特市| 雷山县| 大兴区| 中宁县| 东兴市| 始兴县| 秭归县| 汪清县| 卓尼县| 电白县| 阿克| 洪雅县| 大石桥市| 南雄市| 韶山市| 罗平县| 平和县| 丰顺县| 越西县| 凉城县| 灵寿县| 云梦县| 区。| 天津市| 尚义县| 鄂州市|