## 玛雅历

Description

Haab历和Tzolkin历中的年都用数字0，1，……表示，数字0表示世界的开始。所以第一天被表示成：
Haab: 0. pop 0
Tzolkin: 1 imix 0

Input

Haab历中的数据由如下的方式表示：

Output

Tzolkin历中的数据由如下的方式表示：

Sample Input

3
10. zac 0
0. pop 0
10. zac 1995
Sample Output

3
3 chuen 0
1 imix 0
9 cimi 2801
Source

Central Europe 1995
Translator

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<math.h>
#include<queue>
#include<algorithm>
using namespace std;
const int inf = 0x3f3f3f3f;
//将haab的月份放进数组
char a[25][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol",
"chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
//将Holly的日期放进数组
char b[25][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat",
"muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
int main ()
{
int total;
scanf ("%d",&total);
int q=total;
long long sum;
while (total--){
sum=0;
int day;
char t[30];
int year;
scanf ("%d. %s %d",&day,t,&year);
sum+=day+1;
for (int i=0;i<20;i++){
if (strcmp(a[i],t)==0){
sum+=i*20;
break;
}
}
int d,m,y;
sum+=year*365;
long long temp=sum;
y=temp/260;
if (temp%260==0) y--;//当除尽时减一
m=(temp)%13;
if (m==0)m=13;
d=temp%20;
if (d==0) d=20;
if (total==q-1)printf ("%d\n",q);
printf ("%d %s %d\n",m,b[d-1],y);// d-1是由于下标从0开始
}
return 0;
}

#### POJ-2965:玛雅历

2013-07-06 10:21:11

#### 一个古老的汇编框架

2016-05-18 19:28:16

#### POJ1008玛雅历

2015-07-20 17:09:09

#### 北大OJ_1008题：玛雅历

2015-06-20 16:23:30

#### poj1008--Maya Calendar

2013-04-17 10:32:51

#### POJ1008 玛雅历

2015-12-22 22:31:47

#### 1008

2017-03-16 22:59:03

#### C++之练习题27

2014-08-01 17:08:58

#### OpenJudge百炼-2965-玛雅历-C语言-日期处理

2017-08-10 17:23:30

#### [POJ] 1008 -> 玛雅历

2015-05-05 08:08:38