poj的1008题老是显示runtime error ,求教呀,解决了加分,虽然分不多

#include<stdio.h>#include<string.h>typedefstructyears{intday;charmonth[10];intyear;}Y... #include<stdio.h>
#include<string.h>
typedef struct years
{
int day;
char month[10];
int year;
}YEAR;

int main()
{
int day_input,number_count,index1,index2,year_input,days;
char months[156];
char holly[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk",
"ok","chuen","eb","ben","ix","mem","cib","canban","eanab","canac","ahau"};
char haab[19][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol",
"chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet" };
YEAR calendar1[10];

scanf("%d",&number_count);

for (index1=0;index1<number_count;index1++)
{
scanf("%d.%s%d",&day_input,months,&year_input);
for (index2=0;index2<19;index2++)
{
if (strcmp(months,haab[index2]))
{
continue;
}
else
{
break;
}
}
days=day_input+20*index2+365*year_input;
calendar1[index1].day=days%13+1;
calendar1[index1].year=days/260;
strcpy(calendar1[index1].month,holly[days%20]);

}
printf("%d\n",number_count);
for (index1=0;index1<number_count;index1++)
{
printf("%d %s %d\n", calendar1[index1].day,calendar1[index1].month,calendar1[index1].year);
}

return 0;
}
展开
 我来答
若以下回答无法解决问题,邀请你更新回答
百度网友28b4182
2013-06-27 · TA获得超过7220个赞
知道大有可为答主
回答量:4847
采纳率:100%
帮助的人:1796万
展开全部
YEAR calendar1[10];

数组开太小了。
题目中说了有几个数据啊?
建议开100000
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式