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

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. Input:
One number N - (1 <= N <= 10[sup]1000[/sup])
Output:
Two numbers - first is the single digit number,second total number of operations needed for conversion.
Samples:
[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
[/td][/tr][/table]
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. Input:
One number N - (1 <= N <= 10[sup]1000[/sup])
Output:
Two numbers - first is the single digit number,second total number of operations needed for conversion.
Samples:
[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
[/td][/tr][/table]
15 ноября 2015 в 22:05
Ближайшие курсы

Как начать свой путь в разработке?
Онлайн-курс
6
марта
Профессия 2D-художник: создаем свой первый концепт-арт
Онлайн-курс
6
марта

Как начать свой путь в разработке?
Онлайн-курс
7
марта
Новые статьи

Что такое MVP и как к нему подступиться
30100

Обновляем программу обучения для менеджеров по продажам
24300

BI-системы: что это и зачем они нужны бизнесу
41400