Sum of digits. Given a three-digit number. Find the sum of its digits.
Input |
Output |
179 |
17 |
829 |
19 |
204 |
6 |
100 |
1 |
999 |
27 |
Python, Java
Sum of digits. Given a three-digit number. Find the sum of its digits.
Input |
Output |
179 |
17 |
829 |
19 |
204 |
6 |
100 |
1 |
999 |
27 |