考察函数运用
数字反转
http://www.nowcoder.com/questionTerminal/2687c5c174cb4f938bdae01f0a19490c
#include <stdio.h> int convert(int a) { int b=0; while(a>0) { b*=10; b+=a%10; a/=10; } return b; } int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) { if(convert(a)+convert(b)==convert(a+b)) printf("%d\n",a+b); else printf("NO\n"); } }