#include<iostream>
using namespace std;
void main()
{
char arr[1000];
int a,n;
int s,t;
cin>>a;
getchar();
for(int i=0;i<a;i++)
{
gets(arr);
n=strlen(arr);
s=0;
for(int j=0;j<=n;j++)
{
if(arr[j]==' '||arr[j]=='\0')
{
t=j;
for(int l=t-1;l>=s;l--)
{
cout<<arr[l];
}
s=t+1;
if(s!=n+1)
cout<<" ";
} }
cout<<endl;
}
}
Problem Description
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. <div style="" border-bottom:="" #b7cbff="" 1px="" dashed;="" border-left:="" padding-bottom:="" 6px;="" padding-left:="" padding-right:="" font-family:="" times"="">
Hint
Remember to use getchar() to read '\n' after the interger T, then you may use gets() to read a line and process it.

最新文章

  1. java关于压缩包的处理,我这里贴出三中格式的(zip,rar,tar)解压方法(目前只用到解压,所以压缩过多研究)。
  2. 在 Visual Studio Code 中使用 PoweShell - CodeShell
  3. html5 &lt;input&gt; placeholder 属性
  4. python &amp; pandas链接mysql数据库
  5. pip常用命令
  6. Qt Chart 5.7.0 傻瓜安装教程
  7. 1秒破解 js packer 加密
  8. enode框架
  9. hibernate---一对一单向外键关联--XML
  10. vue-cli3.0 flexible&amp;px2rem 解决第三方ui组件库样式问题
  11. href=&#39;#&#39; 和 href=&#39;###&#39;
  12. Mybatis学习4——核心文件sqlMapperConfig.xml属性
  13. 优雅的vue.js
  14. android中的目录结构介绍
  15. 小白学习之Code First(三)
  16. SOJ 4580 动态规划之01背包 (01背包)
  17. Ionic Js十七:侧栏菜单
  18. 如何把he_llo wo_rld 变成 HeLlo WoRld
  19. 第166天:canvas绘制饼状图动画
  20. Solr调优参考

热门文章

  1. CSS布局(六) 对齐方式
  2. LOJ6002 - 「网络流 24 题」最小路径覆盖
  3. mongodb 3.4 分片 一主 一副 一仲 鉴权集群部署.
  4. Enable multi-tenancy on ironic
  5. 常用校验码(奇偶校验,海明校验,CRC)学习总结
  6. C# 枚举特性 FlagAttribute 的应用
  7. caffe︱ImageData层、DummyData层作为原始数据导入的应用
  8. 实战DeviceIoControl 之三:制作磁盘镜像文件
  9. php和java中的加密和解密
  10. 理解Annotation