练习练习C的IO,后一种日历太无耻那也算是日历么……算出总数就好。C语言的scanf果真神器。
#include<cstdio>
#include<cstring>
char haab[19][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char tzolkin[21][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
int main()
{
int day,year,t,total,i;
scanf("%d",&t);
printf("%d\n",t);
for(int j=0;j<t;j++)
{
char mon[10];
scanf("%d.%s%d",&day,mon,&year);
for(i=0;i<19;i++)
if(!strcmp(mon,haab[i]))
break;
total=i*20+day+year*365;
day=total%13+1;
year=total/260;
i=total%20;
printf("%d %s %d\n",day,tzolkin[i],year);
}
return 0;
}