POJ 1008 Maya Calendar
2015-07-20 15:08
344 查看
This problem is not very hard, just calm your head and pick up your pen, make the relationship of two kinds of calendar.
There are 365 days a year in Haab calendar, 260 days a year in Tzolkin calendar. First, just sum up the total number of days with Haab calendar, it's easy. Second, while the month and the day name of Tzolkin change in circle together, what we should do is
mod 13 to get month and mod 20 to get day name. That's all.
THERE IS ONLY ONE THING TO TAKE CARE: While total number of days exactly 260*X, we should decrease year number, for example:
Haab: 19. mac 0
Tzolink: 13 ahau 0 rather than 13 ahau 1.
THX for your reading, there is no Chinese typer, so just ignore my poor English.
Code is under the The comments section.
There are 365 days a year in Haab calendar, 260 days a year in Tzolkin calendar. First, just sum up the total number of days with Haab calendar, it's easy. Second, while the month and the day name of Tzolkin change in circle together, what we should do is
mod 13 to get month and mod 20 to get day name. That's all.
THERE IS ONLY ONE THING TO TAKE CARE: While total number of days exactly 260*X, we should decrease year number, for example:
Haab: 19. mac 0
Tzolink: 13 ahau 0 rather than 13 ahau 1.
THX for your reading, there is no Chinese typer, so just ignore my poor English.
Code is under the The comments section.
相关文章推荐
- pthread相关资料整理(1)
- 将图片文件流转换成base64字符串
- GRE写作必备句型
- 基于Jpcap的Java ARP断网攻击
- HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包,经典入门题)
- 日志管理--log4j
- mybatis自动生成表的配置文件
- 内联函数的讲解
- hdu 1013 Digital Roots
- 第八章 数据处理的两个基本问题
- Eclipse导出Jar包(包含外部包)
- 使用MG-SOFT的MIB Builder编写mib文件或者.my文件方法
- MySQL replace into
- iOS开发系列--通讯录、蓝牙、内购、GameCenter、iCloud、Passbook系统服务开发汇总
- hive 1.2 配置
- http 415 错误
- spring mvc通过jQuery ajax传值中文乱码问题
- 解决安装windows7或windows 8过程中缺少CD/DVD驱动的报错问题
- poj1925--Spiderman(dp)
- Android通过webservice请求数据