1126 -- 小明A+B

小明A+B

Time Limit:2000MS  Memory Limit:65536K
Total Submit:374 Accepted:148

Description

小明刚上小学一年级,只能计算100以内的整数,且不会进位运算,对他来说88+32=10为什么呢?:P
你的任务就是写一个程序来帮助小明来完成小明的加法运算吧

Input

输入只有一组数据

Output

按照该规则的两数之和

Sample Input

88  32

Sample Output

10

Source

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    namespace AK1126 {
        class Program {
            static void Main(string[] args) {
                string[] sb = Console.ReadLine().Split();
                int a = int.Parse(sb[0]), b = int.Parse(sb[1]);
                int x = (a / 10 + b / 10) % 10;
                int y = (a % 10 + b % 10) % 10;
                if (x == 0)
                    Console.WriteLine(y);
                else
                    Console.WriteLine("{0}{1}", x, y);
                //Console.ReadKey();
            }
        }
    }


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值