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 ic0500510123 at 2005-11-24 10:38:47 on Problem 1008
#include<stdio.h>
#include<string.h>
void main()
{
	char T[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat",
		"muluk","ok","chuen","eb","ben","ix","mem","cib","caban","akbal","canac","ahau"};
	char H[19][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen",
		"yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
	int n,i,date;
	struct{
		int day,mon,year;
		char month[10];
	}haab;
	struct{
		int number,day,year;
	}Tzolkin;
	scanf("%d",&n);
	printf("%d\n",n);
	while(n--)
	{
		scanf("%d.%s %d",&haab.day,haab.month,&haab.year);
		for(i=0;i<19;i++) {if(strcmp(haab.month,H[i])==0) haab.mon=i;}
		date=haab.year*365+haab.mon*20+haab.day+1;
		Tzolkin.year=(int)(date/260);
		Tzolkin.number=(date-Tzolkin.year*260)%13;
		Tzolkin.day=(date-Tzolkin.year*260)%20;
		printf("%d %s %d",Tzolkin.number,T[Tzolkin.day-1],Tzolkin.year);
		printf("\n");
	}
}

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