Competitions
DSA Week 1
The sum of digits
Find the sum of the digits of an integer.
Input
One 32-bit integer n (the number can be negative).
Output
Print the sum of the digits for number n.
Input example #1
321
Output example #1
6
Find the sum of the digits of an integer.
One 32-bit integer n (the number can be negative).
Print the sum of the digits for number n.
321
6