+ 1
Question regarding the \n command
int main() { cout << "C \n"; cout << "+ \n"; cout << "+"; This code gives me the same end results as the code Practice shows me (C + + in diffefent lines), but my code is nowhere the same as the "correct" way. Why did I still get the end result?
4 Respuestas
+ 2
Is it asked to put spaces before new line? Check for that in description.
+ 1
It is. I realise I used the command in the wrong way, or at least differently than it was intended as shown in the results, but I still have got the output correct and thats whats bothering me! The practice tool doesnt see it as being solved tho, when I run the code and go to results, the input part is shown to be empty but both output parts are the same.
+ 1
Try this:
int main()
{
cout << "C\n";
cout << "+\n";
cout << "+";
}
and reply
+ 1
Sololearn does not check your code. All it does is look at the output and compare it to the expected output. If it is identical it is accepted as correct. But it has to be exactly identical including spelling, whitespace, rounding, ...