小明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();
}
}
}