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

怎么还是wa啊~~~~~~~~天哪

Posted by antic_cafe at 2008-03-04 22:25:31 on Problem 1008
#include <stdio.h>
#include<string.h>
int main()
{
	int day,year,num,i,j,r,mon=-1,t;
	char month2[7];
	char month1[][12]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char day2[][11]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	scanf("%d",&num);
	printf("%d",&num);
	for(i=0;i<num;i++)
	{
		scanf("%d%*s %s %d",&day,month2,&year);
		for(j=0;j<19;j++)
		{
			if(!strcmp(month2,month1[j]))
				break;
		}
		t=365*year+20*j+day+1;
		if(t%260==0)
			year=t/260-1;
		else
			year=t/260;
		mon=t%13;
		if(!mon)
			mon=13;
		day=t%20;
		if(!day)
			day=20;
		printf("%d %s %d\n",mon,day2[day-1],year);
	}
    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