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.
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.
For each test case, you should output the text which is processed.
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】模式,将之存入,随后
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】模式,将之存入,随后
相关文章推荐
- [BZOJ3209]花神的数论题
- Failed to create the host-only adapte
- MySql获取各种日期
- java固定种子随机数预测
- hdoj 5015 构造矩阵+矩阵快速幂
- Maven实战(八)——常用Maven插件介绍(下)
- ARM QT移植详细步骤教程
- mountpoint
- broker
- Linux 数据库学习的准备工作---win通过ssh访问ubuntu
- sql之left join、right join、inner join的区别
- Vagrant is attempting to interface with the UI in a way that requires a TTY
- 北大POJ_1079_Ratio
- RAND函数和SRAND函数
- nologin
- codeforces#314C&567C Geometric Progression
- hibernate缓存机制原理
- UML建模学习(一)
- 由家里网络故障谈起
- listview复用 数据重复 id错乱问题已解决