POJ 1008 Maya Calendar

来源:互联网 发布:行而知天下 编辑:程序博客网 时间:2024/06/06 00:13

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.

0 0
原创粉丝点击