hdu 1062

来源:互联网 发布:用js触发a标签的href 编辑:程序博客网 时间:2024/05/16 09:29

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

3olleh !dlrowm'I morf .udhI 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】模式,将之存入,随后






0 0
原创粉丝点击