文章
55
粉丝
100
获赞
12
访问
29.7k
#include <iostream>
#include <vector>
#include<string>
#include<algorithm>
using namespace std;
int reverse(int n){
int sum = 0;
int t = 1;
while(n){
int remain = n%10;
sum = sum*t + remain;
n/=10;
t*=10;
}
return sum;
}
int main(){
int n,m;
while(cin>>n>>m){
int count = n+m;
int a = reverse(n);
int b = reverse(m);
int sum = a+b;
if(sum == reverse(count)){
cout<<count<<endl;
}else{
cout<<"NO"<<endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发