¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
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; }
1 Respuesta