2 shunfurh shunfurh 于 2017.01.06 20:02 提问

X mod f(x) 数论

Problem Description
Here is a function f(x):
   int f ( int x ) {
    if ( x == 0 ) return 0;
    return f ( x / 10 ) + x % 10;
   }

   Now, you want to know, in a given interval A, B, how many integer x that mod f(x) equal to 0.

Input
   The first line has an integer T (1 <= T <= 50), indicate the number of test cases.
   Each test case has two integers A, B.

Output
   For each test case, output only one line containing the case number and an integer indicated the number of x.

SampleInput
2
1 10
11 20

SampleOutput
Case 1: 10
Case 2: 3

1个回答

caozhy
caozhy   Ds   Rxr 2017.01.11 23:52
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!