Sum of digits P33839


Statement
 

pdf   zip

thehtml

Write a program that reads several numbers and prints the sum of the digits of each one.

Input

Input consists of a sequence of natural numbers.

Output

For every number, print the sum of its digits following the format of the example.

Public test cases
  • Input

    29
    7
    0
    1020
    

    Output

    The sum of the digits of 29 is 11.
    The sum of the digits of 7 is 7.
    The sum of the digits of 0 is 0.
    The sum of the digits of 1020 is 3.
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python