山东省第七届ACM省赛------Reversed Words
Reversed Words
Time Limit: 2000MS Memory limit: 131072K
题目描述
Some aliens are learning English. They have a very strange way in writing that they revered every word in the sentence but keep all the words in common order. For example when they want to write “one two three”, they will write down “eno owt eerht”.
Now we’ve got some sentence written by these aliens, translate them! And maybe we will know some of their secrets!
输入
For each test cases, there will be one line contains only lower case letters and spaces. The length of each line will be no more than 10000. Test cases which are longer than 5000 will be less than 50. Continuous letters are seen as a word, words are separated
by spaces. There won’t be two adjacent spaces in the input. Space won’t be the first or the last character.
输出
示例输入
2
eno owt eerhtabcde
示例输出
one two threeedcba
来源
题意
不需要看题目,直接看样例便可以知道题目的意思啦~
#include"stdio.h"
#include"string.h"
#include<iostream>
using namespace std;
char c[10005];
int main()
{
int n;
cin>>n;
getchar();
while(n--)
{
gets(c);
for(int i=0;i<(int)strlen(c);i++)
{
if(c[i]==' ')
{
for(int j=i-1;j>=0&&c[j]!=' ';j--)
putchar(c[j]);
putchar(' ');
}
}
for(int i=strlen(c)-1;i>=0&&c[i]!=' ';i--)
putchar(c[i]);
printf("\n");
}
return 0;
}
山东省第七届ACM省赛------Reversed Words的更多相关文章
- 山东省第七届ACM省赛------Memory Leak
Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...
- 山东省第七届ACM省赛------Triple Nim
Triple Nim Time Limit: 2000MS Memory limit: 65536K 题目描述 Alice and Bob are always playing all kinds o ...
- 山东省第七届ACM省赛------The Binding of Isaac
The Binding of Isaac Time Limit: 2000MS Memory limit: 65536K 题目描述 Ok, now I will introduce this game ...
- 山东省第七届ACM省赛------Fibonacci
Fibonacci Time Limit: 2000MS Memory limit: 131072K 题目描述 Fibonacci numbers are well-known as follow: ...
- 山东省第七届ACM省赛------Julyed
Julyed Time Limit: 2000MS Memory limit: 65536K 题目描述 Julyed is preparing for her CET-6. She has N wor ...
- 山东省第七届ACM省赛
ID Title Hint A Julyed 无 B Fibonacci 打表 C Proxy 最短路径 D Swiss-system tournament 归并排序 E The Binding of ...
- 山东省第十届ACM省赛参赛后的学期总结
5.11,5.12两天的济南之旅结束了,我也参加了人生中第一次正式的acm比赛,虽然是以友情队的身份,但是我依旧十分兴奋. 其实一直想写博客来增加自己的能力的,但是一直拖到现在,正赶上老师要求写一份总 ...
- Rectangles(第七届ACM省赛原题+最长上升子序列)
题目链接: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=1255 描述 Given N (4 <= N <= 100) rec ...
- 山东理工大学第七届ACM校赛-LCM的个数 分类: 比赛 2015-06-26 10:37 18人阅读 评论(0) 收藏
LCM的个数 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 对于我们来说求两个数的LCM(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- centos7 添加svn
预期目的: 1.仓库放在 /var/svn/ 目录下,并且仓库名为 project 2.创建用户组lsgogroup,该组下添加两个成员lsgoweb1.lsgoweb2,密码直接用用户名,两用户可以 ...
- Glide 魔法般的自定义扩展
使用过Glide的朋友都明白,简单的用法就是: Glide.with(context) .load("http://inthecheesefactory.com/uploads/source ...
- 关于smarty的一些个人笔记
注释为{注释} 注意下面代码中<%extends file="路径"%>和<%widget name="路径"%>这两个路径中的区别 c ...
- Hire Me, Microsoft China
为微软中国工作是一个愿望.对于其他的股票期权,令人难以置信的小吃店或很酷的工作室,引诱他们的可能性.很多人都想为微软中国工作,谁知道,也许你就是其中之一.这个博客是专门为在微软中国工作.做它的工作空缺 ...
- iOS 自定义键盘ToolBar(与键盘的弹出、收起保持一致)
1.监听键盘改变的通知 [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyBoardWillCha ...
- sql条件为空查询全部,不为空按条件查询以及多条件筛选查询。
procedure queryLackLonOrLatTdCell(i_region_name varchar2, i_state varchar2) is begin select region_n ...
- const
const int i = 20; int const i = 20; 这两个语句是完全相同的:const与int哪个写在前面都不影响语义. 所以: const int *p; int const ...
- jQuery点击收缩展开滑动显示内容竖直手风琴代码
<div class="position"> <div class="positiontop"> <span class=&quo ...
- log4net 按时间输出日志
参考:(转)非常完善的Log4net详细说明 log4net 按天与按小时记日志的配置 Log4net 中输出日志到文件,文件名根据日期生成 log4net按日志级别(debug,info,warn, ...
- Issue 0:发刊词
最近读吴军博士的文章,很受感悟.知识的成体系地积累过程对一个人的素养提高很有帮助,所以打算开通这本电子期刊,以一周一篇文章的形式汇总今后的知识体系. 宗旨:及时和团队讨论,反馈:善于利用工具.时间越长 ...