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

要崩溃了测试数据都过一直RuntimeError~跪求大神拯救

Posted by DT_Lvhyy at 2013-03-30 09:30:22 on Problem 1008
#include<stdio.h>
#include<string.h>
int main(void){
	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"};
	int t,day,year;
	int Tday,Tyear,Tmonth,sum;
	char tmp[10];
	scanf("%d",&t);
	printf("%d\n",t);
	getchar();
	while(t--){
		scanf("%d.%s%d",&day,tmp,&year);
		int i;
		for(i=0;;i++)
			if(strcmp(Haab[i],tmp)==0)
				break;
		sum=20*i+day+year*365+1;
		Tyear=sum/260;
		if(sum%260==0)
			Tyear--;
		Tday=sum%13;
		if(!Tday)
			Tday=13;
		Tmonth=sum%20;
		if(!Tmonth)
			Tmonth=20;
		Tmonth-=1;
		printf("%d %s %d\n",Tday,Tzolkin[Tmonth],Tyear);
	}
	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