← ~/试题
P2000

Sum of Digits

Easy
// 描述
Given a non-negative integer n, output the sum of its decimal digits.
// 输入格式
A single line containing one integer n (0 <= n <= 10^18).
// 输出格式
A single integer: the sum of the decimal digits of n.
// 提示
Read the number as a string and add up the characters.
// 样例
输入样例
12345
输出样例
15
// 题目信息
难度Easy
通过率50%
时间限制1000 ms
内存限制65536 KB
通过5