山东省第七届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(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- PHP 获取两个日期之间的日期数组/月份数组
function getEmptyArr($s_time,$e_time,$type){ $tmp = array(); if($type=='day'){ $s_time = strtotime($ ...
- 更新与升级 FreeBSD
https://www.freebsd.org/doc/zh_CN/books/handbook/updating-upgrading-freebsdupdate.html 安全补丁存储在远程的机器上 ...
- 判断ecshop未付款添加去付款按钮
判断ecshop未付款添加去付款按钮,打开ecshop模板目录下user_transaction.dwt找到{$item.handler} 这个变量 给它下面添加以下代码 {if $item.pay_ ...
- JMeter学习-028-JMeter默认jmx脚本分发目录(路径)定制
我们在分布式执行参数化脚本时,为尽可能多的利用Slave资源,尽可能将参数文件配置为相对路径,以更好的去适配Slave环境.与此同时,每台Slave的服务jmeter -s 启动的路径可能不尽相同,同 ...
- imx6 DDR_Stress_Test
在调试DDR的时候,有时候需要更改参数.今天发现NXP提供了DDR Stress Test工具,用于DDR参数的校准. 参考链接 http://blog.csdn.net/qq405180763/ar ...
- ios - NSTimer中target的self是强引用问题
当控制器ViewController跳转进入控制器OneViewController中的时候开启定时器,让定时器每隔一段时间打印一次,当OneViewController dismiss的时候,控制器 ...
- 解决从jenkins打开robot framework报告会提示‘Opening Robot Framework log failed ’的问题
最新的jenkins打开jenkins robot framework报告会提示如下 Verify that you have JavaScript enabled in your browser. ...
- Ubuntu 16.04 Steam
Ubuntu 16.04安装Steam,直接去Steam官网下载客户端安装包即可.
- UISegmentedControl 的使用
/** 设置选择器 */ - (void)setUpSegmentCtr { UISegmentedControl *segmentCtr = [[UISegmentedControl alloc] ...
- Mac终端用Sublime打开指定文件或文件夹
首先你先把的sublime放到Application中,再确认您的Sublime的路径是否正确 1 创建别名: sudo ln -s "/Applications/Sublime\ Text ...