Reverse Each Word
InterviewTime limit1sMemory limit128 MB
For each of T sentences, print the words in the same order with the letters inside every word reversed.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Given a sentence, print it with every word reversed. Keep the words in their original order and reverse only the letters inside each word. Every word consists of English letters.
Input
The first line has the number of test cases . Each of the next lines holds one sentence.
A word is at most characters long and a sentence is at most characters long. A single space separates one word from the next.
Output
For each test case, print the sentence with every word reversed, one sentence per line. Keep a single space between words.