惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 步孤天

程序员去新加坡打工的杂事记录 基于Bert的中文评价情感分析 (转载)DeepSeek+LoRA+FastAPI-微调大模型并暴露接口给后端调用 用YOLOv5截取出短剧的人物 Chromium源码分析五:写一个利用ipc+protobuf通信的demo - 步孤天 Chromium源码分析四:RunLoop、Bind、scoped_refptr Chromium源码分析三:Chromium中用到的设计模式 Chromium源码分析二:LifeofaPixel.pdf Chromium源码分析一:基础知识 交叉编译valgrind在嵌入式设备上调试程序 gerrit 反向代理从 apache 换成 nginx 之后项目页报错“The page you requested was not found, or you do not have permission to view this page” golang实现一个简单的文件浏览下载功能代码示例 df查看30GB的磁盘满了而du -sh查看磁盘占用只有6GB centos7+mariadb安装在线评判系统 如何去掉Linux vim文本中的^M 如何从超大(10G)sql语句文本中分离出需要的部分 golang如何打印变量类型,golang list如何把元素转换为可用类型 数据库文件导入报错"MySQL server has gone away" 如何在Linux上用tshark命令把抓包中follow的二进制流保存成文件
六十花甲子纳音表中的五行是怎么算出来的
步孤天 · 2023-08-08 · via 博客园 - 步孤天

一、背景

老人家人经常说谁是什么命,一般地是出自六十花甲子纳音表。
看了纳音表中的五行属性不是按顺序排的,那是怎么算的呢?

二、计算方法

伪代码大概是这样的

//纳音,顾名思义,音只有宫商角徵羽五音,所以只能是1到5
//又因为每个五行都占相邻的两个天干地支,所以就有了下面的对应关系
甲=乙=1
丙=丁=2
戊=己=3
庚=辛=4
壬=癸=5

子=丑=1
寅=卯=2
辰=巳=3
午=未=1
申=酉=2
戌=亥=3

//五行的排序也和别的不同
enum 五行 {
	木=1,
	金=2,
	水=3,
	火=4,
	土=5,
} 

//把要算的天干地支按照上面的数字加起来减到小于五,最后剩的数字就是对应的五行数字
res = 天干 + 地支
while (res > 5) {
	res = res - 5;
}
cout << (五行)res << endl;

三、参考地址

https://zhuanlan.zhihu.com/p/631255018