题解 | #字符逆序#
字符逆序
http://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b
#include <bits/stdc++.h>
using namespace std;
void process(string str, string& res){
reverse(str.begin(), str.end());
res = str;
}
int main(){
string str = "";
while(getline(cin, str)){
string res = "";
process(str, res);
cout << res << endl;
}
return 0;
}
华为题库题解 文章被收录于专栏
牛客华为题库的题解