题目链接:http://codeup.cn/problem.php?cid=100000604&pid=2
题目描述
输入一个字符串,长度小于等于200,然后将数组逆置输出。
输入
测试数据有多组,每组输入一个字符串。
输出
对于每组输入,请输出逆置后的结果。
样例输入
tianqin
样例输出
niqnait
代码
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
string str;
while(getline(cin, str)){
reverse(str.begin(), str.end());
cout<<str<<endl;
}
return 0;
}