+ 5
Why getting all test failed despite my output the same as expected output.
#include <iostream> #include <string> using namespace std; int main() { string word; getline(cin, word); for (int i = word.length(); i >= 0; i--) { cout << word[i]; } return 0; }
3 Réponses
+ 6
// To big index. It should be:
for (int i = word.length()-1; i >= 0; i--) {
cout << word[i];
}
return 0;
}
+ 5
Thanks so much guys i got it now right
+ 2
But is showing all test fail i'm confused