山东省第七届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(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- Springboot数据库连接池报错的解决办法
Springboot数据库连接池报错的解决办法 这个异常通常在Linux服务器上会发生,原因是Linux系统会主动断开一个长时间没有通信的连接 那么我们的问题就是:数据库连接池长时间处于间歇状态,导致 ...
- iOS项目的本地化处理(多国语言)
项目的本地化就是:iOS系统在不同语言环境下自动切换语言,从而实现一个app发布到全世界各个国家的AppStore上. 我们不仅仅需要在iOS项目中做本地化处理,在上架iOS APP的时候,也需要做对 ...
- C++ 一次创建多级目录
#ifdef WIN32 #include <io.h> #include <direct.h> #else #include <unistd.h> #includ ...
- bash shell + python简单教程,让你的mac/linux终端灰起来~
前提条件:已经安装python,命令行支持bash 在bash_profile中添加 function ccolor { python /Users/xirtam/Documents/tools/cc ...
- php 登录注册api接口代码
/** *一览(www.yl1001.com) * PHP开发API接口 服务端 */ require 'conn.php'; //连接数据库的文件 header('Content-Type:text ...
- 简单理解call_user_func和call_user_func_array两个函数
call_user_func():调用一个回调函数处理字符串, 可以用匿名函数,可以用有名函数,可以传递类的方法, 用有名函数时,只需传函数的名称 用类的方法时,要传类的名称和方法名 传递的第一个参数 ...
- Let’s Encrypt 配置
刚配置了下Let's Encrypt,chrome浏览器里有绿条出来,看官网其它平台问题应该也不大.我还没有研究这个工作原理,关键是刚花了几千块给公司买了个收费的证书认证.这里写下配置过程(https ...
- AngularJS Best Practices: ng-include vs directive
For building an HTML template with reusable widgets like header, sidebar, footer, etc. Basically the ...
- Altium Designer 常用的快捷键
ctrl+r 复制并重复黏贴 ctrl+shift+v 只能黏贴 shift+c 取消选择 sp ...
- Quartus II USB-Blaster驱动解决
Quartus II USB-Blaster驱动解决 之前安装Quartus II 13.0,但FPGA开发板链接的USB-Blaster链接无法被Quartus识别,改装Quartus II 11. ...