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 00448236 at 2005-03-03 22:59:08 on Problem 1008
#include <string.h>
#include <stdio.h>

int main()
{
	long int totaldays;
	char yuefeng[10];
	int n,i,j,day1,year1,day2,year2,day_2;
	char *month[19]={"pop","no","zip","zotz","tzec","xul","yoxkin",
		"mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	char *days[20]={"imix","ik","akbal","kan","chicchan","cimi", "manik" ,"lamat","muluk","ok",
		"chuen","eb","ben","ix","mem","cib","caban","eznab", "canac","ahau"};
	scanf("%d",&n);
	for(i=0; i<n; i++)
	{
		
		scanf("%d. ",&day1);
		scanf("%s",yuefeng);
		scanf(" %d",&year1);
		for(j=0;j<19;j++)
		{
			if(strcmp(yuefeng,month[j])==0)
				break;
		}
		totaldays=365*year1+j*20+day1+1;
		year2=(totaldays-1)/260;
		day2=totaldays%13;
		if(day2==0)
			day2=13;
		day_2=totaldays%20;
		if(day_2==0)
			day_2=20;
		day_2-=1;
		printf("%d %s %d\n",day2,days[day_2],year2);
	}
	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