A+B Problem(V) 時間限制:1000 ms | 內存限制:65535 KB 難度:1 描述 做了A+B Problem之後,Yougth感覺太簡單了,於是他想讓你求出兩個數反

#include
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;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章