当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2889:Without Zero

题目描述
Everyone is familiar to the natural number system: 1, 2, 3… Today we will consider a different one: a no-zero number system, which means it only uses the digits 1 through 9. So counting begins with 1, the first "counting number", and continues: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12…, 19, 21…, 98, 99, 111, 112…
So, in this system 9 is the ninth counting number and 11 is the tenth counting number. As usual, addition can be defined by reference to the counting sequence. Addition of the i-th counting number and the j-th counting number is defined to mean the (i+j)-th counting number. Thus, in this system 5 + 8 = 14, since 5 is the fifth counting number, 8 is the eighth, and 14 is the thirteenth counting number. Subtraction is the reverse of addition.
Here is your task, given two numbers: a and b, you should output a subtract b which is defined in no-zero number system.
输入解释
Multiple test cases, each line contains two positive integers: a and b, 1 <= b < a < 1000000000, it is guaranteed that both a and b will not contain digit 0.
输出解释
One line for each case, the result of a subtract b which is defined in no-zero number system.
输入样例
14 5
111 99
191 111
输出样例
8
1
79
来自杭电HDUOJ的附加信息
Recommend gaojie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2889

最后修改于 2020-10-25T22:57:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)