Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求助呀,这个代码为什么是Runtime Error 其他通过的代码复杂度没有什么不同呀

Posted by halbupt at 2012-08-18 19:05:27 on Problem 1008
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator