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 DavidCameron at 2017-02-11 10:33:09 on Problem 1008
#include<stdio.h>
#include<string.h>

char* haab[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char* tzolkin[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};

int main()
{
int set;
scanf("%d",&set);
printf("%d\n",set);
for(int i=0;i<set;i++)
{
int hday,hyear,day;
char* hmonth;
scanf("%d. %s %d",&hday,hmonth,&hyear);
int j=0;
for(;j<19;j++)
if(strcmp(hmonth,haab[j])==0)
break;
day=hyear*365+j*20+hday;
int tday,tperiod,tyear;
tyear=day/260;
tperiod=day%13+1;
tday=day%20;
printf("%d %s %d\n",tperiod,tzolkin[tday],tyear);
}
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