1 задача в консольном режиме С++

Asyl Yerzhanov
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.  To predict person's fate, numerologist takes time of a person's life in seconds,then adds all it's digits together. If that sum of digits is bigger than single digit, the "additional" operation is repeated until it will be a single digit. Then to figure out person's fate numerologist needs a total number of operations needed to convert a number from origin to sigle digit.
Numerologist is not a scientific man,so he is not so good in math. Write a program that will do all the calculations for him.
One number N - (1 <= N <= 10[sup]1000[/sup])
Two numbers - first is the single digit number,second total number of operations needed for conversion.
[table][tr][th]№[/th][th]Input[/th][th]Output[/th][/tr][tr][td]1[/td][td]1[/td][td]1 0[/td][/tr][tr][td]2[/td][td]10[/td][td]1 1[/td][/tr][tr][td]3[/td][td]99[/td][td]9 2
Asyl Yerzhanov около 2 лет назадСпасибо 0
0 чел.