POJ 1008 Maya Calendar

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章