文章
145
粉丝
217
获赞
21
访问
84.2k
#include <stdio.h>
int Reverse(int n)
{
int m = 0;
while(n)
{
m = m*10+n%10;
n/=10;
}
return m;
}
int main()
{
int a,b;
while(scanf("%d %d",&a,&b) != EOF)
{
int sum1 = a+b,sum2;
sum2 = Reverse(a) + Reverse(b);
if(Reverse(sum1) == sum2)
printf("%d\n",sum1);
else printf("NO\n");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发