Source
Problem Id:1008 User Id:dynamic
Memory:20K Time:0MS
Language:C++ Result:Accepted
#include <stdio.h>
#include <string.h>
char month1[19][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char month2[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
int main()
{
int n,year,day,mon,t;
char s[10];
scanf("%d",&n);
printf("%d\n",n);
while(n--){
scanf("%d. %s %d",&day,s,&year);
for(mon=0;mon<19;mon++) if (strcmp(month1[mon],s)==0) break;
t=year*365+mon*20+day;
printf("%d %s %d\n",1+t%13,month2[t%20],t/260);
}
return 0;
}