题解 | #字符串反转#
字符串反转
https://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
#include <iostream>
#include <string>
int main(int argc, char* argv[]){
std::string str;
std::cin >> str;
for(int i = 0, j = str.size() - 1; i < j; ++i, --j){
std::swap(str[i], str[j]);
}
std::cout << str << std::endl;
return 0;
}