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 1151190119 at 2017-03-09 22:14:49 on Problem 1008
#include<stdio.h>
#include<string.h>
int main(){
	int n;
	char *Haab[19]={	"pop","no","zip","zotz","tzec",
						"xul","yoxkin","mol","chen","yax",
						"zac","ceh","mac","kankin","muan",
						"pax","koyab","cumhu","uayet"};
	char *Tzolkin[20]={	"imix","ik","akbal","kan","chicchan",
						"cimi","manik","lamat","muluk","ok",
						"chuen","eb","ben","ix","mem",
						"cib","caban","eznab","canac","ahau"};
	char str[10];
	int year,month,day,count;
	scanf("%d",&n);
	while(n--){
		scanf("%d. %s%d",&day,str,&year);
		if(!strcmp(str,"uayet")&&day>4 )continue ;
		for(month=0;month<19;month++)
			if(!strcmp(str,Haab[month]))break;
		count = year * 365 + month * 20 + day ;
		printf("%d %s %d\n",count%13 + 1,	Tzolkin[count%20],	count/260);
	}
	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