Problems
10145 - Sum of Digits
SUBMIT PROBLEM

Sum of Digits

Time Limit: 1 sec

 

The Problem

Write a program which accepts an integer between 0 and 9999 and returns the sum of  all digits in the number.

 

The Input

There are several lines of input in the input file. Each line contains one integer numbers N (0<=N<=9999). Input is terminated by EOF.

 

The Output

For each line of input you have to print a line of output, this line contains the sum of all digits in the number N.

 

Sample Input

12

999

3475

 

Sample Output

3

27

19

 

 

 

Inter University Programming Contest - 2017 [BGC Trust University Bangladesh]

Problem Setter: Shahin ShamS