文章
27
粉丝
0
获赞
143
访问
23.8k
 
#include<bits/stdc++.h>
using namespace std;
int main() {
    int m, n;
    while(cin>>m>>n) {
        int ans = m + n; 
        string s1 = to_string(m);
        string s2 = to_string(n);
        string s = to_string(ans);
        reverse(s1.begin(), s1.end());
        reverse(s2.begin(), s2.end());
        reverse(s.begin(), s.end());
        int rem = stoi(s1);
        int ren = stoi(s2);
        int reans = stoi(s);
        //cout<<ans<<" "<<reans<<endl; 
        if(rem + ren == reans) cout<<ans<<endl;
&n...
登录后发布评论
暂无评论,来抢沙发