zoj 1295 Reverse Text
Reverse Text
Time Limit: 2 Seconds Memory Limit: 65536 KB
In most languages, text is written from left to right. However, there are other languages where text is read and written from right to left. As a first step towards a program that automatically translates from a left-to-right language into a right-to-left language and back, you are to write a program that changes the direction of a given text.
Input Specification
The input contains several test cases. The first line contains an integer specifying the number of test cases. Each test case consists of a single line of text which contains at most 70 characters. However, the newline character at the end of each line is not considered to be part of the line.
Output Specification
For each test case, print a line containing the characters of the input line in reverse order.
Sample Input
3
Frankly, I don't think we'll make much
money out of this scheme.
madam I'm adam
Sample Output
hcum ekam ll'ew kniht t'nod I ,ylknarF
.emehcs siht fo tuo yenom
mada m'I madam
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
int n;
string s;
cin >> n;
cin.get();
//getchar();//头文件是#include <cstdio>
while(n--){
getline(cin, s);
reverse(s.begin(), s.end());
cout << s << endl;
}
//system("pause");
return ;
}
zoj 1295 Reverse Text的更多相关文章
- TJU Problem 1644 Reverse Text
注意: int N; cin >> N; cin.ignore(); 同于 int N; scanf("%d\n",&N); 另:关于 cin 与 scanf: ...
- HDOJ/HDU 1321 Reverse Text(倒序输出~)
Problem Description In most languages, text is written from left to right. However, there are other ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- "字符反向拼接"组件:<reverse> —— 快应用组件库H-UI
 <import name="reverse" src="../Common/ui/h-ui/text/c_text_reverse"></ ...
- 杭电ACM分类
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- input中如何输入逆写的中文句子
<input style="text-align:right" /><input type="text" dir="rtl" ...
- 一位学长的ACM总结(感触颇深)
发信人: fennec (fennec), 信区: Algorithm 标 题: acm 总结 by fennec 发信站: 吉林大学牡丹园站 (Wed Dec 8 16:27:55 2004) AC ...
随机推荐
- 贴图、纹理、材质的区别是什么? 还有shader
贴图.纹理.材质的区别是什么? 还有shader 整个 CG 领域中这三个概念都是差不多的,在一般的实践中,大致上的层级关系是:材质 Material包含贴图 Map,贴图包含纹理 Texture.纹 ...
- canvas基础绘制-倒计时(下)
digit_1.js: digit = [ [ [0,0,1,1,1,0,0], [0,1,1,0,1,1,0], [1,1,0,0,0,1,1], [1,1,0,0,0,1,1], [1,1,0,0 ...
- ubuntu 下service php5-fpm restart 报错 stop: Unknown instance: 解决
问题描述: 在安装完扩展后,重启php-fpm,发现一直停止报错 stop: Unknown instance: 通过查看进程,也查询不到该主进程 解决办法: 干掉现在正在执行的进程 pkill ph ...
- 在一台电脑上运行两个或多个tomcat
在一台电脑上运行多个tomcat 在本例中,使用两个tomcat做示例 工具/原料 tomcat 安装好jdk,并且配置好环境变量 方法/步骤 首先去apache下载一个tomcat, ...
- Android系统级技巧合集
Android系统级技巧合集(随时更新) #转载请注明来源# 1.高通骁龙系列查看CPU体质等级 CPU体质,即为CPU在工作频率下的电压.同一批次的CPU体质各有不同,体质越高,代表该颗CPU可在更 ...
- fork后子进程从哪里开始执行
子进程和父进程都从调用fork函数的下一条语句开始执行
- uva10735 Euler Circuit
题外话:很多混合图问题可以转化为有向图问题(将无向边拆为两条有向边) 本题不行,因为只能经过一次 这种问题能想到网络流.. 复习欧拉回路:入度==出度 和uva1380有点相似,要先给无向边定向.原图 ...
- CAD交互绘制圆弧(网页版)
在CAD设计时,需要绘制圆弧,用户可以在图面点圆弧起点,圆弧上的一点和圆弧的终点,这样就绘制出圆弧. 主要用到函数说明: _DMxDrawX::DrawArc2 由圆弧上的三点绘制一个圆弧.详细说明如 ...
- java基本框架
public class 文件名 { public static void mian(string[] args) { 自己的代码: } }
- 2018 CCPC 女生赛 hdoj6288 缺失的数据范围
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6288 Summarize:1.二分查找答案: 2.自带log函数精度不够,需自己写: 3.注意二分递归 ...