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?
9 Respuestas
+ 1
Sometimes, along with some punctuation marks or spaces, you'd better copy the original text.
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
0
\n or not \n , puzzling to eyes.
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;
}
}
}
0
"cout << c"
That would have been incorrect. It would have read
15Beep
1413121110Beep
98765Beep
4321
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
0
How about now? Solved?
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.
0
Whatever, maybe something not essential lost, let it go.