DWITE, October 2011, Problem 4
According to recent surveys run by various Computer Science Clubs at Canadian high schools, is a cool digit. That's why we are going to define the "coolness" of a number to be the number of
s it has (e.g.
has a coolness of
, whereas
has no coolness). This makes counting a very cool activity, which begs the question: exactly how cool is it to be able to count up to
? We are interested in finding the total coolness of all numbers from
up to a given number.
There will be five lines of input, each containing a single number .
You should output five lines, each line the sum of the coolness of all the numbers from to
inclusive.
Sample Input
0
13
55
4
100
Sample Output
1
2
6
1
12
Problem Resource: DWITE
Comments