文章
20
粉丝
0
获赞
64
访问
11.5k
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
int c=a+b;
string ss=to_string(c);
reverse(ss.begin(),ss.end());
int y=stoi(ss);
string s1=to_string(a);
string s2=to_string(b);
reverse(s1.begin(),s1.end());
reverse(s2.begin(),s2.end());
int a1=stoi(s1);
int a2=stoi(s2);
int x=a1+a2;
if(x==y){
cout<<c<<endl;
}else{
cout<<"NO"<<endl;
&nbs...
登录后发布评论
暂无评论,来抢沙发