1295 Reverse Text
来源:互联网 发布:网络安全管理架构图 编辑:程序博客网 时间:2024/05/22 14:24
Total Submit: 5736 Accepted Submit: 2463
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
Problem Source: Southwestern Europe 1996, Practice
http://acm.zju.edu.cn/show_problem.php?pid=1295
#include <cstdlib>
using namespace std;
char text[10000];
void read();
void reverse();
int main()
...{
int n;
cin >> n;
getchar();
for ( int i = 0; i < n; i++ )
...{
read();
reverse();
}
return 0;
}
void read()
...{
gets(text);
}
void reverse()
...{
for ( int i = strlen(text)-1; i >= 0; i-- )
...{
cout << text[i];
}
cout << endl;
}
- 1295 Reverse Text
- zoj 1295 Reverse Text
- zoj 1295 Reverse Text
- ZOJ 1295 Reverse Text
- ZOJ 1295 Reverse Text
- ZOJ 1295: Reverse Text
- ZOJ - 1295 - Reverse Text
- ZOJ 1295 - Reverse Text
- ZOJ - 1295 Reverse Text
- Reverse Text
- Reverse Text
- Reverse Text
- Text Reverse
- Reverse Text
- Text Reverse
- Text Reverse
- Reverse Text
- Text Reverse
- linux 文件 Cache 管理
- Java精华积累:每个初学者都应该搞懂的问题
- Talking about 随便说说字符集和编码(转)
- VS2005图标默认存放位置
- 远程登陆vm虚拟的linux的具体设置[转]
- 1295 Reverse Text
- 常用温度测量技术及其接口电路
- 漂亮的红果儿校内网代码
- RSA算法原理
- 独钓寒江校内网主题代码
- 揭开Socket编程的面纱
- 手工删除自动运行病毒(nwizs.exe病毒)
- 2008年2月28日 日语 发音规则
- PC处理器发展史