+ 10
Declined challenge quiz 😐
//Thanks for the submission, but it seems the code is not matching the answer. Please correct and resubmit. But the answer is correct 100%, and yes it was tricky code. Did this happen to anyone???
10 odpowiedzi
+ 4
Voja R C language standard define as "undefined behaviour" when you use an uninitialized var (like sum in your code). This mean that on some compilers, sum will be inited with 0 value (getting your result) on others compiler, instead sum will be not-initialized and will contain random data (usually called gargabe data ).
I think that for this your challenge is not been accepted
+ 10
KrOW oh, makes sense
thanks a lot 😃
+ 8
https://code.sololearn.com/c0aoMapDuSfP/?ref=app
sum is not inside for loop, so the answer is not 6 (as it seems) but 4.
Yes, in quiz I selected 4 as correct answer and the code is the same (no syntax errors, I copied submitted version and pasted here to check output)
+ 3
Well, if its not valid, he have nothing to spoil 😃
+ 2
Maybe he doesn't want to show his riddle and spoil it.
Checking to make sure is definitely a good idea.
+ 1
Can you post the submitted text and answer?
+ 1
The reasoning seems a bit random at times. I got 'too many similar problems exist' although not even once I had seen that pattern in a challenge.
But because the answer is wrong? Strange... Maybe the decliner was tired?
In your place I'd run the code again to see if I'm really really right, check the spelling and indentation very carefully - and then maybe submit it a second time.
+ 1
I think that its better if he post the challenge and the answer because he can have not noticed something ..
+ 1
Hehe, how's that for cheering someone up: 'Please show us the riddle, it sucks anyway!' :'-D
Voja R, everybody can make a mistake; maybe you spelled something incorrectly, maybe the judge missed that it actually works... IF you test your riddle again, exactly as it is, and it really shows the result you said it does, I'd offer it again. But make sure!
+ 1
Voja R 👍👍👍