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 |
不能忍了!狂查四个小时,仍然是WA~~那位仁兄能仗义相助啊~~#include<iostream.h> #include<stdio.h> #include<string.h> void main() { const char Haabm[19][7]={"pop","no","zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh","mac","kankin", "muan", "pax", "koyab", "cumhu","uayet"}; const char Tzolkinname[20][9]={ "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben" , "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; char Hmname[7],Tname[9]; int Hnum,Tnum,Hyear,Tyear,Tnami; int days,times; scanf("%d",×); for(int e=0;e<times;e++) { days=0; scanf("%d. %s %d",&Hnum,Hmname,&Hyear); days+=365*Hyear;//cout<<days<<endl; for(int i=0;(stricmp(Hmname,Haabm[i]));i++) {};days=days+20*i+Hnum+1; Tyear=days/260;//Maybe different if(days%20==0) Tnami=19; else Tnami=days%20-1;//Important strcpy(Tname,Tzolkinname[Tnami]);// if(days%13==0) Tnum=13;//important else Tnum=days%13; printf("%d %s %d\n",Tnum,Tname,Tyear); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator