题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe?tpId=37&tags=&title=&difficulty=0&judgeStatus=0&rp=1&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D2%26tpId%3D37%26type%3D37
/* 思路: 直接以 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")