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

终于AC了,一个字母打错就完蛋~~~

Posted by cooker at 2011-08-08 20:59:57 on Problem 1008
#include <stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
	int Ty;
	int Hd,Hy;
	char hm[7];
	int n,i,d=0;
	char Td[20][9]={"imix","ik","akbal","kan","chicchan",
		"cimi","manik","lamat","muluk","ok","chuen","eb",
		"ben","ix","mem","cib","caban","eznab","canac","ahau"};
	char Hm[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen",
		"yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	scanf("%d",&n);
	printf("%d\n",n);
	while(n--)
	{
		scanf("%d",&Hd);
		getchar();getchar();
		scanf("%s%d",hm,&Hy);
		for(i=0;i<19;i++)
		{
			if(strcmp(hm,Hm[i])==0)
			{
				d=(i*20+Hd+Hy*365);
				break;
			}
		}
		printf("%d %s %d\n",d%13+1,Td[d%20],d/260);
	}
	system("pause");
	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