My Pig Latin code works correctly but doesn't pass any test in Code Coach⁉️🤔 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

My Pig Latin code works correctly but doesn't pass any test in Code Coach⁉️🤔

https://code.sololearn.com/cE0JT4qSxSAV/?ref=app There are no spaces at the beginning & end of my output‼️ I also tried with " " and ' '‼️ My result is the same as expected‼️

15th Jan 2020, 9:44 AM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
17 Answers
+ 5
for (i=1; i<int(strlen(w)); i++) Remove the = and should work
15th Jan 2020, 10:01 AM
Mihai Apostol
Mihai Apostol - avatar
+ 8
Mihai Apostol Thx, UR genius ‼️😃 With "=" I probably cout'ed the invisible '\0' character, which ends the string so the visible output was correct but tests failed ⁉️🤔 HonFu Thx, U2 tried ‼️😃
15th Jan 2020, 12:39 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 8
Александр Ширяев Thx a lot ‼️ but now, my code is working correctly in CC‼️😃 But there is one interesting thing⁉️🤔 One week ago, your /& my/ code wouldn't pass the CC tests because it leaves "space" character after the last word / ... << "ay" << " " / . Earlier CC tests were more rigorous & not pass such bugs. It was a problem because the leading and trailing spaces in the string are invisible so I have to use lines 13 & 14 in my code /superfluous now/. But probably, SoloLearn crew has softened approvals and let a space at the end of the sentence. BTW why are you using variable "n"⁉️🤔
17th Jan 2020, 11:49 AM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 8
Александр Ширяев It's 🆗‼️ Nobody is perfect‼️ but you are trying ‼️🤔☺️😃
17th Jan 2020, 12:00 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 7
Coder Kitten Thx, excellent advice‼️😃 Now I see clearly‼️🤣
15th Jan 2020, 12:55 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 7
RudyNieRadosny More szczęścia & RADOŚCI in new year 2020‼️☺️😃🤣😁
17th Jan 2020, 12:16 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 7
Edward SoloLearn crew sanitized input data in some CC challenges⁉️ Check f.ex. "It's a Sign" & "Splitting Strings"‼️
18th Jan 2020, 10:01 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 6
Some inputs in code challenge are “dirty” with non-printable characters. I struggled in a couple of them, until I began to sanitize every input.
15th Jan 2020, 7:30 PM
Edward
Edward - avatar
+ 6
Edward UR right ‼️ but this time I "produced" one extra character which was difficult to debug bcs his invisibility ‼️🤔
15th Jan 2020, 8:45 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
+ 3
I've only been studying programming for 2 months, and on my own. My codes are far from perfect.
17th Jan 2020, 11:55 AM
Александр Ширяев
Александр Ширяев - avatar
+ 2
Strange. Looks like it should work.
15th Jan 2020, 9:57 AM
HonFu
HonFu - avatar
+ 2
I haven't done it in c++. I did it in Ruby, with the "chomp" method. I will keep this in mind when I try it in C++. Thank you.
16th Jan 2020, 10:55 PM
Fernando Pozzetti
Fernando Pozzetti - avatar
+ 1
I Can't 😢😭 understand at all
16th Jan 2020, 9:35 PM
Alab
+ 1
wow
16th Jan 2020, 10:09 PM
Natali
Natali - avatar
+ 1
You can use my code. word=ordway.
17th Jan 2020, 9:07 AM
Александр Ширяев
Александр Ширяев - avatar
+ 1
Spasibo :)
17th Jan 2020, 12:18 PM
Александр Ширяев
Александр Ширяев - avatar
- 3
Debilu jd
17th Jan 2020, 8:35 AM
RudyNieRadosny
RudyNieRadosny - avatar