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<stdio.h> #include<string.h> int main() { long day,tatoldays; int N,i,j,year,month; char Haabmonth[19][10]={"pop"," no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; char Tzolkinday[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; char temp[10]; scanf("%d",&N); printf("%d\n",N); for(i=0;i<N;i++) { tatoldays=0; scanf("%d. %s %d",&day,temp,&year); for(j=0;j<19;j++) { if(strcmp(Haabmonth[j],temp)==0) break; } tatoldays=year*365+20*j+day; month=1+tatoldays%13; day=tatoldays%20; year=tatoldays/260; printf("%d %s %d\n",month,Tzolkinday[day],year); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator