Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
要崩溃了测试数据都过一直RuntimeError~跪求大神拯救#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator