A+B Problem(V) 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 做了A+B Problem之后,Yougth感觉太简单了,于是他想让你求出两个数反

来源:互联网 发布:windows 95iso下载 编辑:程序博客网 时间:2024/05/22 06:28
#include<stdio.h>
int main()
{
    int i,j,a,b,n,m;
    while(1)
    {
        scanf("%d%d",&m,&n);
        if(m==0 && n==0)
        {
            break;
        }
        i=0;
        while(m!=0)
        {
            a=m%10;
            i=i*10+a;
            m=(m-a)/10;
        }
        j=0;
        while(n!=0)
        {
            b=n%10;
            j=j*10+b;
            n=(n-b)/10;
        }
        printf("%d\n",i+j);
    }
    return 0;
}
0 0
原创粉丝点击