-->
当前位置:首页 > 题库

PROGRAMMING:Number root

Luz5年前 (2021-05-10)题库378
The number root is the recursive sum of all the numbers in the number.
Given a positive integer n, take the sum of the numbers. If the sum has more than one digit, please continue to calculate the sum until the result is one digit.
`Example: 132189 -- > 1 + 3 + 2 + 1 + 8 + 9 = 24 -- > 2 + 4 = 6`
###Input format:
Enter a positive integer n.
###Output format:
Output the final result
###Input example:
```in
one hundred and thirty-two thousand one hundred and eighty-nine
```
###Output example:
```out
six
```







answer:If there is no answer, please comment