/*
模拟题,细心点就好了,没难度。
Habb历一年365天
Tzolkin历一年260天
先计算Habb历从第0天到输入日期的总天数sumday
Sumday/day就是Tzolkin历的年份
Tzolkin历的天数Name每20一循环,先建立Tzolkin历天数Name与1~20的映射,
因此Sumday %20+1就是Tzolkin历的天数Name
Tzolkin历的天数ID每13一循环,且从1开始,则Sumday %13+1就是Tzolkin历的天数ID
*/
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char H[19][10]={"pop","no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
char T[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
int day,year;
char month[10];
int n,i,j,days;
cin>>n;
cout<<n<<endl;
for(i=0;i<n;i++)
{
scanf("%d. %s %d",&day,month,&year);
for(j=0;j<19;j++)
{
if(!strcmp(month,H[j])) break;
}
days=year*365+j*20+day;
cout<<1+days%13<<" "<<T[days%20]<<" "<<days/260<<endl;
}
return 0;
}
日历之 poj1008玛雅日历
最新推荐文章于 2019-01-22 00:25:22 发布