SRM 315 DigitsSum
SRM 315 DigitsSum

Little Johnny is in the first grade and just found out about addition.
He quickly learned the addition table and is becoming bored in class, so
he thinks of a game. The game consists of choosing an integer and
summing its digits. If the result is a single digit, the game ends.
Otherwise, Johnny repeats the process on the result until he gets a
single digit.

seantcanavan/topcoder