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 xiaoguazi0008 at 2018-02-24 18:42:05 on Problem 1008
#include<stdio.h>
#include<string.h>
int main()
{
	long day,tatoldays;
	int N,i,j,year,month;
	char Haabmonth[19][10]={"pop"," no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
	char Tzolkinday[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	char temp[10];
	scanf("%d",&N);
	printf("%d\n",N);
	for(i=0;i<N;i++)
	{
		tatoldays=0;
		scanf("%d. %s %d",&day,temp,&year);
		for(j=0;j<19;j++)
		{
			if(strcmp(Haabmonth[j],temp)==0) break;
		}
		tatoldays=year*365+20*j+day;
		month=1+tatoldays%13;
		day=tatoldays%20;
		year=tatoldays/260;
		printf("%d %s %d\n",month,Tzolkinday[day],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