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 1264310280 at 2011-03-07 20:20:21 on Problem 1008
#include<stdio.h>
#include<string.h>
void main()
{
	int line,j,day,year,month_1,year_1,day_1;
	int sum;
	char month[10];
	char ha_m[18][8]={{"pop"},{"no"},{"zip"},{"zotz"},{"tzec"},{"xul"},{"yoxkin"},{"mol"},{"chen"},
	{"yax"},{"zac"},{"ceh"},{"mac"},{"kankin"},{"muan"},{"pax"},{"koyab"},{"cumhu"}};
	char tz_d[20][10]={{"imix"},{"ik"},{"akbal"},{"kan"},{"chicchan"},{"cimi"},{"manik"},{"lamat"},{"muluk"},
	{"ok"},{"chuen"},{"eb"},{"ben"},{"ix"},{"mem"},{"cib"},{"caban"},{"eznab"},{"canac"},{"ahau"}};
		scanf("%d",&line);
		printf("%d\n",line);
		while(line--)
			{
				j=0;
				scanf("%d.%s%d",&day,&month,&year);
				for(j=0;j<19;j++)
				{
					if(strcmp(ha_m[j],month)==0)
						break;
				}
				sum=year*365+j*20+day;
					year_1=sum/260;
					if(sum%260==0)year_1--;
					month_1=sum%13;
					if(month_1==0)month_1=13;
					day_1=sum%20-1;
					if(day_1==-1)day_1=19;
					printf("%d %s %d\n",month_1,tz_d[day_1],year_1);
			}
}
真是搞不懂,所有能找到的数据都试了,还是wa,帮忙看看吧!

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