How to code in code coach? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

How to code in code coach?

I did a code for extraterrestrial problem in code coach... Cud run it n get correct output in computer... But all 5 test cases are shown as failed in code coach result section...y is it so...?

17th Oct 2020, 10:59 AM
Shilpa
5 Answers
+ 2
Shilpa It would be great to include the code in discussion, so that somebody can help fix its bugs.
17th Oct 2020, 11:14 AM
E1ias
E1ias - avatar
0
As already told, Copy code to playground, save and share link here.. So that it helps to see the mistakes..
17th Oct 2020, 12:20 PM
Jayakrishna 🇮🇳
0
Ok #include <iostream> using namespace std; int main() { string myString; cout<<"Enter an English word: "; cin>>myString; int size = myString.length(); char *cStr = new char [size]; for(int x=0, y=size-1; x<size; x++,y--) { cStr[y] = myString.at(x); } cout<<endl; for(int x =0; x<size; x++) { cout<<cStr[x]; } delete [] cStr; return 0; }
17th Oct 2020, 12:21 PM
Shilpa
0
Code coach need only the output.. As it checks only the output by program.. So the statement cout<<"Enter an English word:" ; is not needed. Remove it then it works..
17th Oct 2020, 12:24 PM
Jayakrishna 🇮🇳
0
Thank you so much... It did work ..
17th Oct 2020, 12:26 PM
Shilpa