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