← ~/試題
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