# poj_1008 Maya Calendar（模拟题）

16 篇文章 0 订阅

【题目】

【思路】

【代码】

#include <stdio.h>
#include <string.h>

int main()
{
long int n,i,j;
scanf("%d",&n);
printf("%d\n",n);
char month[19][10]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
char month_t[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
for (i=0;i<n;i++)
{
long int day,year,total=0;
char mo[10];
scanf("%d",&day);getchar();
scanf("%s",mo);
scanf("%d",&year);
total+=year*365+day+1;
for (j=0;j<19;j++){if (strcmp(month[j],mo)==0) break; else total+=20;}
printf("%d ",(total%13==0)? 13:total%13);
printf("%s ",month_t[(total%20==0)? 19:total%20-1]);
printf("%d\n",(total%260>0)? total/260:total/260-1);
}
return 0;
}

• 0
点赞
• 0
收藏
觉得还不错? 一键收藏
• 打赏
• 0
评论
11-17 228
01-22 572
08-22 696
04-07 89
06-07 92
11-23 392
04-11 137
10-22 740
07-30 563
08-27 1815
07-29 8352
07-18 1929
06-28 632
07-22 84
09-22 293
03-21 419
04-11 787

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

¥1 ¥2 ¥4 ¥6 ¥10 ¥20

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、付费专栏及课程。