国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 石首市| 仁怀市| 饶河县| 自治县| 襄樊市| 余姚市| 四子王旗| 延长县| 精河县| 库尔勒市| 遵化市| 尤溪县| 青冈县| 白城市| 宝山区| 乌审旗| 加查县| 鄂伦春自治旗| 南宫市| 丘北县| 乌拉特前旗| 嵊州市| 兴文县| 曲周县| 尚义县| 新乡县| 龙陵县| 马公市| 高淳县| 调兵山市| 巩义市| 雅江县| 连州市| 永新县| 康平县| 梁河县| 泽库县| 景德镇市| 泾川县| 论坛| 荥经县|