Pro.ID21775 TitleWithout Zero Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21775 AC6 Submit25 Ratio24.00% 时间&空间限制描述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. 输出Description 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. Input 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. Output One line for each case, the result of a subtract b which is defined in no-zero number system. Sample Input 14 5 Sample Output 8 Source 样例输入14 5 样例输出8 作者 |