Tổng các chữ số

View as PDF



Author:
Problem types
Points: 10 (p) Time limit: 2.0s Memory limit: 256M Input: stdin Output: stdout

Viết chương trình tính tổng các chữ số của một số nguyên dương \(n\) cho trước.

Input Specification

Gồm số nguyên dương \(n\) được ghi trên một dòng duy nhất.

Output Specification

In ra kết quả trên một dòng.

Constraints

\(n \leq 10^{12}\)

Input Sample

123456

Output Sample

21

Comments

There are no comments at the moment.