Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

好,贴出来了,大哥给俺看看吧

Posted by Azaza at 2005-08-15 20:19:08 on Problem 1008
In Reply To:贴出来,帮你看,谁有时间做数据? Posted by:sunmoonstar_love at 2005-08-08 18:08:33
#include<iostream>
#include<string>
using namespace std;
int main()
{
	char hmon[10],tmon[10];
	char *mm[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
		"zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char *nn[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok",
		"chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};

	int hyear,tyear,test;
	int hday,tday;
	long total;
	int i,tmpmon;
	while(cin>>test)
	{
		cout<<test<<endl;
		for(i=0;i<test;i++)
		{
			scanf("%d. %s %d",&hday,&hmon,&hyear);
			for(int j=0;j<20;j++)
				if(strcmp(hmon,mm[j])==0)
					break;
			if(hyear%400==0||(hyear%4==0&&hyear%100!=0))
				total=hyear*366+20*j+hday;
			else total=hyear*365+20*j+hday;
			tyear=total/260;
			tday=total%13+1; 
			tmpmon=total%20;
			strcpy(tmon,nn[tmpmon]);
			printf("%d %s %d\n",tday,tmon,tyear);
		}
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator