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 |
求助呀,这个代码为什么是Runtime Error 其他通过的代码复杂度没有什么不同呀#include<stdio.h> #include<string.h> main() { char Tk[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; char Hb[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"}; int N, days, HbDay, HbYear, TkMon, TkYear; char HbMon[7]; int i, j, k; scanf("%d", &N); printf("%d\n", N); for(i = 0; i < N; i++) { scanf("%d.%s %d", &HbDay, &HbMon, &HbYear); for(j = 0; strcmp(HbMon,Hb[j]); j++); days = j * 20 + HbDay + 1 + HbYear * 365; TkYear = days / 260; TkMon = days % 13 ; if(TkMon == 0) TkMon = 13; k = (days - 1) % 20 ; printf("%d %s %d\n", TkMon, Tk[k], TkYear); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator