在多数语言中,文本都是从左写到右。然而,有些语言中,文本是从右读写到左。现
在,你将来编写一个程序,把一段从左到右书写的文本自动转换为从右写到左的文本。
2.输入详细情况
输入包含多个测试案例。第一行是一个整数,代表测试案例的数目。每个测试案例由
一行组成,至多
70 个字符。但是,每行末尾的换行符不作为该测试案例的字符。
3.输出详细情况
对于每个测试案例,在一行上打印出输入行的反向文本。
4.输入样例
3
Frankly, I don't think we'll make much
money out of this scheme.
madam I'm adam
5.输出样例
hcum ekam ll'ew kniht t'nod I ,ylknarF
.emehcs siht fo tuo yenom
mada m'I madam
#include "stdafx.h"
#include<fstream>
#include<iostream>
#include<stdlib.h>
#include<string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int num;
fstream in("D:\\visual studio 2013 code\\test.txt");
char temp[80];
string str;
in >> num;
for (int i = 0; i<=num; i++)
{
in.getline(temp, 80);
str = temp;
reverse(str.begin(), str.end());
cout << str << endl;
}
return 0;
}