題目鏈接: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;
}