做了A+B Problem之后,Yougth感觉太简单了,于是他想让你求出两个数反转后相加的值。帮帮他吧
1234 1234 125 117 0 0
8642 1232
#include<stdio.h>
int main()
{
int
m,n;
while(scanf("%d
%d",&m,&n),m!=0&&n!=0)
{
int
a=0,b=0;
while(m>0)
{
a=a*10+m%10;
m/=10;
}
while(n>0)
{
b=b*10+n%10;
n/=10;
}
printf("%d\n",a+b);
}
return
0;
}
在这里,1234变为4321可以通过
int t=0;
while(m>0)
{
t=t*10+m%10;
m=m/10;
}
原文:http://www.cnblogs.com/dreamgoing/p/3565466.html