1272: (2026)实验1-2A 三位数各位和 / Sum of Digits of a 3-digit Integer
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:48
Solved:20
Description
【中文题面】
输入一个三位正整数,求它各位数字之和。
例如输入 425,百位、十位、个位分别为 4、2、5,因此结果为 11。
[English Description]
Input a 3-digit positive integer and output the sum of its digits.
For example, for 425, the digits are 4, 2, and 5, so the result is 11.
输入一个三位正整数,求它各位数字之和。
例如输入 425,百位、十位、个位分别为 4、2、5,因此结果为 11。
[English Desc
Input a 3-digit positive integer and output the sum of its digits.
For example, for 425, the digits are 4, 2, and 5, so the result is 11.
Input
【输入】
输入一个三位正整数。
[Input]
One 3-digit positive integer.
输入一个三位正整数。
[Input]
One 3-digit positive integer.
Output
【输出】
输出一个整数,表示各位数字之和。
[Output]
Output one integer, the sum of all digits.
输出一个整数,表示各位数字之和。
[Output]
Output one integer, the sum of all digits.
Sample Input Copy
425
Sample Output Copy
11
HINT
提示:百位 n/100,十位 (n/10)%10,个位 n%10。