您的位置:首页 > 其它

hdu 1062

2015-08-07 11:28 267 查看
Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them.


Input

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.

Each test case contains a single line with several words. There will be at most 1000 characters in a line.


Output

For each test case, you should output the text which is processed.


Sample Input

3
olleh !dlrow
m'I morf .udh
I ekil .mca


Sample Output

hello world!
I'm from hdu.
I like acm.
Hint
Remember to use getchar() to read '\n' after the interger T, then you may use gets() to read a line and process it.

题意:输入一个字符串,将字符串中的 单词反转后输出,一次反转一个。

思路:先列读取进行的位数,随后for循环内进行反转与输出。

批:关键点未理顺,回车是进行下一项的标志未看到,所以不应用回车。

思路:使用str【i】【1000】模式,将之存入,随后
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: