0

Output exactly the same as expected output, but marked wrong?

I'm doing the C++ course. I already know some C++. In one of the tests, where they compare the output from your program against the expected output, my output reads EXACTLY and to the letter the same as the expected output, but it is being marked as wrong. Has anyone else had this issue?

4th Jan 2022, 3:34 AM
Mimsy
9 odpowiedzi
+ 1
Sometimes, along with some punctuation marks or spaces, you'd better copy the original text.
4th Jan 2022, 3:50 AM
FanYu
FanYu - avatar
0
When I say identical, I really mean identical. My output was 15 Beep 14 13 12 11 10 Beep 9 8 7 6 5 Beep 4 3 2 1 And the expected output was 15 Beep 14 13 12 11 10 Beep 9 8 7 6 5 Beep 4 3 2 1 I went over it for any possible difference - it's exactly the same
4th Jan 2022, 4:26 AM
Mimsy
0
\n or not \n , puzzling to eyes.
4th Jan 2022, 5:15 AM
FanYu
FanYu - avatar
0
Actually I just ran it again, and it accepted it this time. ?? I have no idea, frankly. My code was: int main() { int n; cin >> n; int i; for (i = 0; i <= n; i++) { int c = n - i; cout << c << '\n'; if (c % 5 == 0) { cout << "Beep\n"; } if (c == 1) { break; } } }
4th Jan 2022, 5:21 AM
Mimsy
0
"cout << c" That would have been incorrect. It would have read 15Beep 1413121110Beep 98765Beep 4321
4th Jan 2022, 5:27 AM
Mimsy
0
No, because first time around I forgot to put in any new lines, and it was rejected then as well. Then I put in the new lines - rejected, turned off my computer, came back and tried again (same solution) and it was accepted
4th Jan 2022, 5:35 AM
Mimsy
0
How about now? Solved?
4th Jan 2022, 5:36 AM
FanYu
FanYu - avatar
0
Solved? Well, the program accepted my solution, but it was the same solution it rejected before. So my question remains unanswered, but at least I can move onto the next unit.
4th Jan 2022, 5:38 AM
Mimsy
0
Whatever, maybe something not essential lost, let it go.
4th Jan 2022, 5:47 AM
FanYu
FanYu - avatar