It doesn't accept my code even though it matches | SoloLearn: Learn to code for FREE!

+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

c++

11/21/2020 3:19:38 PM

Alex Mih

15 Answers

New Answer

+10

Check for spelling errors and blank spaces

+5

Alex Mih , you wrote "I love C++", instead of "I look be coding".

+3

Hint: you need to edit your sentence. Read the question carefully.

+2

My be using main function is not suitable for printing,instead using namespace std()is enough. Two like main and namespace is common for arguments. In my knowledge, I'm still in medium level heeheee😁😁😁

+2

I thought we can't use another header for adjacent functions .😁😁😁

+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

Brian it's that free practice code coach question......his code doesn't solve all the test cases....

+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