在他上次休假,在教授
M. A. Ya旧玛雅历法时候有一个惊人的发现,从一个老的打结消息,教授发现玛雅文明使用365一天为一年,叫做Haab,有十九个月,前十八个月每个月都有20天的长度,并且名字是 pop, no, zip, zotz, tzec, xul, yoxkin, mol, chen, yax, zac, ceh, mac, kankin, muan, pax, koyab, cumhu.可以使用0-19替换每天的名字,在Haab历最后一个月叫做uayet并且有5天用数字0, 1, 2, 3, 4表示,玛雅相信这个月是不幸的,法院关闭,贸易停止,甚至人们不扫地。
宗教认为,玛雅使用另一种叫做卓尔金历的历法,一年分为十三期,每期有20天的长度,每天都用一个名称表示: imix, ik, akbal, kan, chicchan, cimi, manik, lamat, muluk, ok, chuen, eb, ben, ix, mem, cib, caban, eznab, canac, ahau 和十三个数字表示周期,这样每天都有一个数字表示,
从一年的开始计算依次是
1 imix, 2 ik, 3 akbal, 4 kan, 5 chicchan, 6 cimi, 7 manik, 8 lamat, 9 muluk, 10 ok, 11 chuen, 12 eb, 13 ben, 1 ix, 2 mem, 3 cib, 4 caban, 5 eznab, 6 canac, 7 ahau, and again in the next period 8 imix, 9 ik, 10 akbal . . .
就是做历法转换,把这个叫Haab 的历法转换成卓尔金的
先算出来都属于那一天然后输出....
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include<stdio.h>
#include<
string.h>
#define maxn 1000
char HaabMonth[
19][
10] = {
"
pop
",
"
no
",
"
zip
",
"
zotz
",
"
tzec
",
"
xul
",
"
yoxkin
",
"
mol
",
"
chen
",
"
yax
",
"
zac
",
"
ceh
",
"
mac
",
"
kankin
",
"
muan
",
"
pax
",
"
koyab
",
"
cumhu
",
"
uayet
"};
char TzolkinDay[
20][
10] = {
"
imix
",
"
ik
",
"
akbal
",
"
kan
",
"
chicchan
",
"
cimi
",
"
manik
",
"
lamat
",
"
muluk
",
"
ok
",
"
chuen
",
"
eb
",
"
ben
",
"
ix
",
"
mem
",
"
cib
",
"
caban
",
"
eznab
",
"
canac
",
"
ahau
"};
int FindMonth(
char M[])
{
int i;
for(i=
0; i<
19; i++)
if(strcmp(M, HaabMonth[i]) ==
0)
break;
return i;
}
int main()
{
int n;
scanf(
"
%d
", &n);
printf(
"
%d\n
", n);
while(n--)
{
int M, D, Y, days=
0;
char s[
20];
scanf(
"
%d. %s %d
", &D, s, &Y);
M = FindMonth(s);
days = Y*
365 + M *
20 + D;
Y = days / (
13*
20);
days %= (
13*
20);
printf(
"
%d %s %d\n
", days%
13+
1, TzolkinDay[days%
20], Y);
}
return
0;
}