20. Sum of Digits
EasyMath
Print the sum of the decimal digits of a non-negative integer (it may be very large).
Input format
A single non-negative integer.
Output format
The digit sum.
Example 1
Input
12345
Output
15
Example 2
Input
0
Output
0
Constraints
Up to 1000 digits
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…