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 PostHow can we possibly tell you what's wrong with the code without seeing it?
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.
All 7 Replies
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
exonwarrior
Salem
5,138
Posting Sage
exonwarrior
Salem
5,138
Posting Sage
exonwarrior
Salem
5,138
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.