LCC '18 Contest 4 J2 - Dereck and Essays

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Dereck is infuriated with his English teacher because she said that the Earth is round. To get back at her, he has decided to take sentences from his essay and reverse the order of the characters in every word (words are separated by only one space).

Input Specification

The first line will contain one string, S (1 \le |S| \le 2000), consisting of English letters and punctuation.

Output Specification

On the first line, output S with the order of the characters in every word reversed.

Sample Input

Derek loves to eat dim sum, but it is always a hassle to figure out how much he is going to pay.

Sample Output

kereD sevol ot tae mid ,mus tub ti si syawla a elssah ot erugif tuo woh hcum eh si gniog ot .yap

Comments

There are no comments at the moment.