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 <string.h> #include <stdio.h> int main() { long int totaldays; char yuefeng[10]; int n,i,j,day1,year1,day2,year2,day_2; char *month[19]={"pop","no","zip","zotz","tzec","xul","yoxkin", "mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; char *days[20]={"imix","ik","akbal","kan","chicchan","cimi", "manik" ,"lamat","muluk","ok", "chuen","eb","ben","ix","mem","cib","caban","eznab", "canac","ahau"}; scanf("%d",&n); for(i=0; i<n; i++) { scanf("%d. ",&day1); scanf("%s",yuefeng); scanf(" %d",&year1); for(j=0;j<19;j++) { if(strcmp(yuefeng,month[j])==0) break; } totaldays=365*year1+j*20+day1+1; year2=(totaldays-1)/260; day2=totaldays%13; if(day2==0) day2=13; day_2=totaldays%20; if(day_2==0) day_2=20; day_2-=1; printf("%d %s %d\n",day2,days[day_2],year2); } return 0; } 救命啊,我已经花了三个小时检查错误,但还是不知道为啥....请各位看一下啊…… 谢谢啊…… Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator