Write a program to reverse each word in a sentence. There should not be any extra spaces at the end.
Input (String) |
Output (String) |
I love mom |
mom love I |
I like my brother |
brother my like I |
Sun rises in the east |
east the in rises Sun |
Learn Java with Merit Campus |
Campus Merit with Java Learn |
India won world cup in 2011 |
2011 in cup world won India |