Hey all,
I'm writing a program in C++ for a contest. The code executes no problem on my computer at school that I'm writing it on. I get all the correct answers. When I upload it however, it keeps on saying "runtime error (SIGSEGV)"
Please Help!!
here's the link to the site so you know what the program is supposed to do.
https://hs.spoj.pl/problems/HS09UBT/
Thanks in Advance,
Dave

exonwarrior
Recommended Answers
Jump to Post> for (int k = 0; array[k]!=0; k++)
Use the value of i from the previous loop, to count how many elements you have.You're assuming your array is filled with zeros - it isn't.
Jump to PostDo you type in more than 1000 numbers?
Show how you run the code, and the output you get.
Paste a terminal log of say 10 lines of input (does it crash at that point?)
All 7 Replies
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

exonwarrior
Salem 5,265 Posting Sage

exonwarrior
Salem 5,265 Posting Sage

exonwarrior
Salem 5,265 Posting Sage
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.