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 |
在下新手,求找错#include<stdio.h> #include<string.h> int main() { int i,n,date,month,year,day,flag=1; char cmonth[7],haab[15],Haab[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"},Tzolkin[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; scanf("%d",&n); while(n>0) { fflush(stdin); gets(haab); sscanf(haab,"%d%*c%s%d",&day,cmonth,&year); if(flag) printf("%d\n",n); flag=0; for(i=0;i<19;i++) if(strcmp(cmonth,Haab[i])==0) { month=i; break; } date=year*365+day+1+month*20; if(date%260!=0) { day=date%13; year=date/260; strcpy(cmonth,Tzolkin[(date%260-1)%20]); printf("%d %s %d\n",day,cmonth,year); } else printf("13 ahau %d\n",date/260-1); n--; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator