题目链接:字符逆序_牛客题霸_牛客网
注意点:
reverse的头文件是algorithm
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string str, res;
while (getline(cin ,str)){
reverse(str.begin(), str.end());
cout << str << endl;
}
return 0;
}