well, split the string of words by space first, then you can loop through it and reverse the words in each loop.
You can use the string methods like
split() and
reverse()