题解 | 23年OPPO-a的翻转

#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main() {
    int a;
    cin >> a;

    string b_str = to_string(a);
    reverse(b_str.begin(), b_str.end());
    int b = stoi(b_str);

    cout << a + b << endl;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

DBsan:我也遇到过好的HR,全程友好交流。这年头基本的礼貌和尊重为什么好多HR都做不到
找工作时遇到的神仙HR
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务