文章
13
粉丝
386
获赞
2
访问
65.7k
#include <iostream>
#include <cstdio>
using namespace std;
int reverse(int x){
int res = 0;
while(x != 0){
res = res * 10 + x % 10;
x /= 10;
}
return res;
}
int main(){
int x1, y1, res1;
int x2, y2, res2;
while(scanf("%d%d", &x1, &y1) != EOF){
res1 = x1 + y1;
x2 = reverse(x1);
y2 = reverse(y1);
res2 = x2 + y2;
if(res2 == reverse(res1)) printf("%d\n", res1);
else printf("NO\n");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发