/* 思路: 直接以 string 形式获得输入的数据 调用 reverse 函数对数据做翻转操作 */ #include <algorithm> #include <iostream> using namespace std; int main() { string str; cin >> str; reverse(str.begin(), str.end()); cout << str << endl; } // 64 位输出请用 printf("%lld")
/* 思路: 直接以 string 形式获得输入的数据 调用 reverse 函数对数据做翻转操作 */ #include <algorithm> #include <iostream> using namespace std; int main() { string str; cin >> str; reverse(str.begin(), str.end()); cout << str << endl; } // 64 位输出请用 printf("%lld")