当前位置:首页 大学排名 杭州电子科技大学acm1280题我为什么错了?

杭州电子科技大学acm1280题我为什么错了?

发布时间:2023-06-17 18:27:09

runtime

error(access_violation)是运行时错误,非法访问内存,比如数组越界或者堆栈溢出。

杭州电子科技大学acm1280题我为什么错了?

看看题目要求:

input

contains

multiple

test

cases.

each

test

case

starts

with

a

number

n

(

0 <

n

<=

1000

) -- the

total

number

of balloons

distributed. the next n

lines

contain

one

color

each.

the

color

of

杭州电子科技大学acm1280题我为什么错了?

a

balloon

is

a

string

of

up

to

15

lower-case

letters.

a

test

case

with

n

=

0

terminates

the input

and

this

test

case

is

not

to

be

processed.

而你的程序:

a=(char

**)malloc(

杭州电子科技大学acm1280题我为什么错了?

10

*sizeof(char

*));

用个超过10个的case就越界了。

温馨提示:
本文【杭州电子科技大学acm1280题我为什么错了?】由作者 大学问答 转载提供。 该文观点仅代表作者本人, 自学教育网 信息发布平台,仅提供信息存储空间服务, 若存在侵权问题,请及时联系管理员或作者进行删除。
(c)2008-2025 自学教育网 All Rights Reserved 汕头市灵创科技有限公司
粤ICP备2024240640号-6