+ 2
It doesn't accept my code even though it matches
#include <iostream> using namespace std; int main() { //modify given statement cout << "Roses are red \nViolets are blue \nI love C++ \nAnd you will like it too!" << endl; return 0; } Basically, or need to output: Roses are red Violets are blue I look be coding And you will too
15 ответов
+ 12
Check for spelling errors and blank spaces
+ 5
Alex Mih , you wrote "I love C++", instead of "I look be coding".
+ 2
; is missing
+ 1
It's in the code coach part of the c++ course it doesn't give any information other than the fact that it is wrong
+ 1
BeegCat thank you.
I found the lesson here:
https://www.sololearn.com/learn/CPlusPlus/1604/
+ 1
#include <iostream>
using namespace std;
int main() {
//modify given statement
cout << "Roses are red\n Violets are blue\n I love C++\n And you will like it too!" << endl;
return 0;
}
Alex Mih Use the above. It's only testing how you can use the newline character "\n". The space should be after the new line character and not before. Check the difference between our codes.
+ 1
I didn't get any issues
0
Thanks but the code still looks correct. I'll take the lesson again
0
I copied and pasted the code into the SoloLearn Coding Playground and it ran without error.
Are you running it in the C++ playground, not under some other language?
What error are you getting?
0
What test cases
0
Alex Mih I had the same problem. Chack that: https://www.sololearn.com/Discuss/2590360/?ref=app