Sum of Digits


Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

題目說明

請撰寫一個程式,要求使用者輸入一個兩位數或三位數的正整數,程式會將該數字的各位數字加總並輸出結果。

輸入

一個兩位數或三位數的正整數。

輸出

該數字的各位數加總結果。

範例輸入 #1

123

範例輸出 #1

6

範例輸入 #2

45

範例輸出 #2

9

Comments

There are no comments at the moment.