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

 2025-01-24 10:42:01  阅读 979  评论 0

摘要:runtimeerror(access_violation)是运行时错误,非法访问内存,比如数组越界或者堆栈溢出。看看题目要求:inputcontainsmultipletestcases.eachtestcasestartswithanumbern(0

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

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(

10

*sizeof(char

*));

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

版权声明:我们致力于保护作者版权,注重分享,被刊用文章【杭州电子科技大学acm1280题我为什么错了?】因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理!;

原文链接:https://www.yxiso.com/zhishi/1119971.html

发表评论:

关于我们
院校搜的目标不仅是为用户提供数据和信息,更是成为每一位学子梦想实现的桥梁。我们相信,通过准确的信息与专业的指导,每一位学子都能找到属于自己的教育之路,迈向成功的未来。助力每一个梦想,实现更美好的未来!
联系方式
电话:
地址:广东省中山市
Email:beimuxi@protonmail.com

Copyright © 2022 院校搜 Inc. 保留所有权利。 Powered by BEIMUCMS 3.0.3

页面耗时0.0337秒, 内存占用1.98 MB, 访问数据库22次

陕ICP备14005772号-15