1
2
3
4
5
6
Use the "Verify Solution" button to get AI feedback on your C++ code.
You are tasked with implementing a function reverseWords that takes a std::string representing a sentence and reverses each individual word within the sentence, while maintaining the original order of the words.
For example: Input: "Hello World" Output: "olleH dlroW"
The function should handle multiple spaces between words and leading/trailing spaces correctly. The output should have single spaces separating reversed words.