#include <bits/stdc++.h>
using namespace std;

string a,b;

int main(){
    cin>>a;
    b = a;
    reverse(b.begin(),b.end());
    cout<<stoi(a)+stoi(b);

    return 0;
}

将b = a,然后按照题目将数字反转,最后用stoi将两个字符串分别转为数字加起来输出就好了

#牛客春招刷题训练营#https://www.nowcoder.com/discuss/727521113110073344