编程题:String Builder, the Hex
You are going to read four **hexdecimal** numbers: n, a, b, c, like this:
11 2 5 3
First, *n* is used to build up a string from 0 to n, like this:
0123456789ABCDEF1011
is a string build up for *n=0x11*, where the numbers are in hexdecimal.
Then, in all the hexdecimal digits from index *a* to index *b*, count the appearence of hexdecimal digit *c*.
For the string above, *2 5* is:
2345
Thus the appearence of *3* is 1.
### Input Format:
Four positive numbers, *n*, *a*, *b* and *c*, where $$a<b<n<10000$$, and $$0<=c<=F$$..
Letters in c is always in **upper case**.
### Output Format:
One number represnets the length of the generated string, in **decimal**.
One number represents the apprence of *c*, in **decimal**.
There is a space between the two numbers.
### Sample Input:
in
11 2 12 A
### Sample Output:
out
20 1
答案:若无答案欢迎评论
11 2 5 3
First, *n* is used to build up a string from 0 to n, like this:
0123456789ABCDEF1011
is a string build up for *n=0x11*, where the numbers are in hexdecimal.
Then, in all the hexdecimal digits from index *a* to index *b*, count the appearence of hexdecimal digit *c*.
For the string above, *2 5* is:
2345
Thus the appearence of *3* is 1.
### Input Format:
Four positive numbers, *n*, *a*, *b* and *c*, where $$a<b<n<10000$$, and $$0<=c<=F$$..
Letters in c is always in **upper case**.
### Output Format:
One number represnets the length of the generated string, in **decimal**.
One number represents the apprence of *c*, in **decimal**.
There is a space between the two numbers.
### Sample Input:
in
11 2 12 A
### Sample Output:
out
20 1
答案:若无答案欢迎评论