http://poj.org/problem?id=1008&lang=default&change=true
这个题倒是不难,就是麻烦一点,但是还WA了几次都是因为处理天数的时候没处理好,因为Haab这个日历日期是从0开始的,所以当第一年的最后一天第364天,而如果输入的恰好是365天应该是第二年的,所以,那个天数要放在下面处理
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std ;
int main()
{
int n ;
scanf("%d",&n) ;
printf("%d\n",n);
for(int i = ; i <= n ; i++)
{
int day,year ;
char month[];
scanf("%d",&day) ;
getchar();
cin>>month ;
cin>>year ;
int mon ;
if(strcmp(month,"pop")==) mon = ;
if(strcmp(month,"no")==) mon = ;
if(strcmp(month,"zip")==) mon = ;
if(strcmp(month,"zotz")==) mon = ;
if(strcmp(month,"tzec")==) mon = ;
if(strcmp(month,"xul")==) mon = ;
if(strcmp(month,"yoxkin")==) mon = ;
if(strcmp(month,"mol")==) mon = ;
if(strcmp(month,"chen")==) mon = ;
if(strcmp(month,"yax")==) mon = ;
if(strcmp(month,"zac")==) mon = ;
if(strcmp(month,"ceh")==) mon = ;
if(strcmp(month,"mac")==) mon = ;
if(strcmp(month,"kankin")==) mon = ;
if(strcmp(month,"muan")==) mon = ;
if(strcmp(month,"pax")==) mon = ;
if(strcmp(month,"koyab")==) mon = ;
if(strcmp(month,"cumhu")==) mon = ;
if(strcmp(month,"uayet")==) mon = ;
int days = (year*)+(mon-)*+day;
printf("%d ",days%%+);
int Tdays = days%%+ ;
if(Tdays == ) cout<<"imix";
if(Tdays == ) cout<<"ik";
if(Tdays == ) cout<<"akbal";
if(Tdays == ) cout<<"kan";
if(Tdays == ) cout<<"chicchan";
if(Tdays == ) cout<<"cimi";
if(Tdays == ) cout<<"manik";
if(Tdays == ) cout<<"lamat";
if(Tdays == ) cout<<"muluk";
if(Tdays == ) cout<<"ok";
if(Tdays == ) cout<<"chuen";
if(Tdays == ) cout<<"eb";
if(Tdays == ) cout<<"ben";
if(Tdays == ) cout<<"ix";
if(Tdays == ) cout<<"mem";
if(Tdays == ) cout<<"cib";
if(Tdays == ) cout<<"caban";
if(Tdays == ) cout<<"eznab";
if(Tdays == ) cout<<"canac";
if(Tdays == ) cout<<"ahau";
//int Tyears = (year*365)/260 ;
int Tyears = days/;
cout<<" "<<Tyears<<endl ;
}
return ;
}