Pls can someone please help me with my pig latin code, my output is the same as expected but i still fail the test | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pls can someone please help me with my pig latin code, my output is the same as expected but i still fail the test

https://www.sololearn.com/coach/16?ref=app #include <iostream> #include <cstring> using namespace std; int main(){ char sentence[100]; string arrword[100]; int j = 0; cin.getline(sentence, 100); char* pointer; pointer = strtok(sentence, " "); while(pointer != NULL){ arrword[j] = pointer; pointer = strtok(NULL, " "); j++; } for(int i = 0; i < j; i++){ string eachword = arrword[i]; int length; char a,b; length = eachword.length(); a = eachword[0]; eachword[0] = 0; cout << eachword << a << "ay "; } return 0; }

18th Jan 2020, 9:44 AM
Oluwatowo Rosanwo
Oluwatowo Rosanwo - avatar
1 Answer
18th Jan 2020, 10:24 AM
Mihai Apostol
Mihai Apostol - avatar