山东省第七届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(最小公倍数)是很容易的事,现在我遇到了 ...
随机推荐
- C/C++语言,自学资源,滚动更新中……
首先要说<一本通>是一个很好的学习C/C++语言的自学教材. 以下教学视频中,缺少对"字符串"技术的讨论,大家注意看书. 一维数组,及其举例:(第四版) ...
- canvas 拖拽实现
Canvas 依赖分辨率 不支持事件处理器 弱的文本渲染能力 能够以 .png 或 .jpg 格式保存结果图像 最适合图像密集型的游戏,其中的许多对象会被频繁重绘 SVG 不依赖分辨率 支持事件处理器 ...
- Bypass WAF Cookbook
PS.之前一直想把零零碎碎的知识整理下来,作为知识沉淀下来,正好借着wooyun峰会的机会将之前的流程又梳理了一遍,于是就有了下文.也希望整理的内容能给甲方工作者或则白帽子带来一些收获. 0x00 概 ...
- 在Hyper-V中安装和配置Ubuntu网络
http://www.abcde.cn/knowledgebase/845/Hyper-VUbuntu.html (文中的nameserver要改成自己路由器的IP:我的是192.168.2.1.) ...
- 一个js简单的日历显示效果的函数
用一个函数简单的实现一个月份的日历,效果如下: 这个日历效果有高亮显示,我实现的思维比较简单. 我把上面的日历效果用表格table生成,分成两个部分. 第一个部分:就是前面的第一排,我用一行<t ...
- SpringSecurity操作指南-在SpringMVC项目上配置Spring Security
- javascript中的正则表达式学习
一.前言 关于正则表达式自身的语法这里不做过多介绍(详情可参见http://www.php100.com/manual/unze.html),这里仅仅解释javascript中和正则表达式相关的几个方 ...
- Javascript Promise入门
是什么? https://www.promisejs.org/ What is a promise? The core idea behind promises is that a promise r ...
- [Python] 删除指定目录下后缀为 xxx 的过期文件
import os import time import datetime def should_remove(path, pattern, days): if not path.endswith(p ...
- object_id用法
特别是在建表建存储过程的时候进场会写到: IF OBJECT_ID('Table_Test','U') IS NOT NULL DROP TABLE Table_Test 这种方式代替了以往所使用的 ...