poj_1008

/*
//ACM Poj 1008
//File: 1008.cpp
//Author: Kangzj
//Mail: Kangzj@mail.bnu.edu.cn
//Date: April 29, 2009
*/
#include
#include
using namespace std;
struct TYD
{
	int Dnum;
	string Dname;
};
int main()
{
    string TkDays[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	string HbMons[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
	ostringstream buff;
	TYD Tday;
	int i,j,n;
	int Hyear,Hday, Tyear;
	string Hdaystr, Hmonth;
	int days,Tdays;
	cin>>n;
	buff< >Hdaystr>>Hmonth>>Hyear;
		Hdaystr=Hdaystr.substr(0,Hdaystr.size()-1);
		if (Hdaystr.size()==2)
		{
			Hday=(Hdaystr[0]-'0')*10+(Hdaystr[1]-'0');
		}else
		{
			Hday=(Hdaystr[0]-'0');
		}
		if(Hmonth=="uayet")
		{
			j=18;
		}
		else
		{
			for(j=0;j<18;j++)
			{
				if(Hmonth==HbMons[j])
				{
					break;
				}
			}
		}
		days=Hyear*365+j*20+Hday;
		Tyear=days/260;
		Tdays=days%260;//注意边界!
		Tday.Dname=TkDays[Tdays%20];
		Tday.Dnum=Tdays%13+1;
		buff< 

Leave a Reply

Your email address will not be published. Required fields are marked *