码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-01-26 11:54:08      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

#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;
}

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

标签:

原文地址:http://blog.csdn.net/cq1042713261/article/details/43150491

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!