HUSTOJ
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
ContestProblemSetList
Login
Register
Problem G: 各位数字和(while语句、整除及整除求余运算符)
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:17
Solved:16
Return to contest
Submit
Submit Record
ShowOff!
Description
输入任意正整数n,输出其各位数字上的和
Input
任意正整数n(0<=n<=2147483647)
Output
各位数字上的和
Sample Input
Copy
123456
Sample Output
Copy
21
Source/Category
while
循环结构