题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int input = 0;
cin >> input;
string str = to_string(input); // 使用to_string 将int转换成string
reverse(str.begin(), str.end()); // 使用reverse翻转字符串
cout << str;
}
// 64 位输出请用 printf("%lld")
360集团公司氛围 383人发布
